[geary/wip/765516-gtk-widget-conversation-viewer: 187/187] Workaround a GTK+ crasher, Bug 771812.



commit 7c950dd32083f8704fde6f7e26d2f1f7899a3160
Author: Michael James Gratton <mike vee net>
Date:   Fri Sep 23 10:44:41 2016 +1000

    Workaround a GTK+ crasher, Bug 771812.

 src/client/composer/composer-widget.vala |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index 8c7c6e6..4704104 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -1181,6 +1181,18 @@ public class ComposerWidget : Gtk.EventBox {
         Gtk.Widget? focus = this.container.top_window.get_focus();
         this.container.remove_composer();
         ComposerWindow window = new ComposerWindow(this);
+
+        // Workaround a GTK+ crasher, Bug 771812. When the composer is
+        // re-parented, its menu_button's popover keeps a reference to
+        // the conversation window's viewport, so when that is removed
+        // it has a null parent and we crash. To reproduce: Reply
+        // inline, detach the composer, then choose a different
+        // conversation back in the main window. The workaround here
+        // sets a new menu model and hence the menu_button constructs
+        // a new popover.
+        this.actions.change_action_state(ACTION_COMPOSE_AS_HTML,
+            GearyApplication.instance.config.compose_as_html);
+
         this.state = ComposerWidget.ComposerState.DETACHED;
         if (focus != null && focus.parent.visible) {
             ComposerWindow focus_win = focus.get_toplevel() as ComposerWindow;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]