[geary: 1/2] Fix crash when opening a detached composer window
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary: 1/2] Fix crash when opening a detached composer window
- Date: Wed, 26 Jun 2019 06:16:08 +0000 (UTC)
commit fd954009bd2e9f9e8e8b27c8b3f44def6c3317dd
Author: Jon Banafato <jon jonafato com>
Date: Wed Jun 26 01:24:32 2019 -0400
Fix crash when opening a detached composer window
Pass an application instance to the `ComposerWindow` upon construction.
Fixes #476.
src/client/components/main-window.vala | 2 +-
src/client/composer/composer-widget.vala | 2 +-
src/client/composer/composer-window.vala | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/client/components/main-window.vala b/src/client/components/main-window.vala
index e66a11ff..133acff1 100644
--- a/src/client/components/main-window.vala
+++ b/src/client/components/main-window.vala
@@ -220,7 +220,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
if (has_composer) {
composer.state = ComposerWidget.ComposerState.DETACHED;
- new ComposerWindow(composer);
+ new ComposerWindow(composer, this.application);
} else {
this.conversation_viewer.do_compose(composer);
get_action(Application.Controller.ACTION_FIND_IN_CONVERSATION).set_enabled(false);
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index 92d9bb50..85965c45 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -1199,7 +1199,7 @@ public class ComposerWidget : Gtk.EventBox, Geary.BaseInterface {
Gtk.Widget? focused_widget = this.container.top_window.get_focus();
this.container.remove_composer();
- ComposerWindow new_window = new ComposerWindow(this);
+ ComposerWindow new_window = new ComposerWindow(this, this.application);
// Workaround a GTK+ crasher, Bug 771812. When the composer is
// re-parented, its menu_button's popover keeps a reference to
diff --git a/src/client/composer/composer-window.vala b/src/client/composer/composer-window.vala
index 4ca5872a..f8165be5 100644
--- a/src/client/composer/composer-window.vala
+++ b/src/client/composer/composer-window.vala
@@ -29,7 +29,7 @@ public class ComposerWindow : Gtk.ApplicationWindow, ComposerContainer {
private bool closing = false;
- public ComposerWindow(ComposerWidget composer) {
+ public ComposerWindow(ComposerWidget composer, GearyApplication application) {
Object(application: application, type: Gtk.WindowType.TOPLEVEL);
this.composer = composer;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]