[geary/geary-0.12] Fix broken composer when invoked from a mailto: link in a conversation.



commit 417f02b8267913d48665731eefc06f62ccf9f98f
Author: Michael James Gratton <mike vee net>
Date:   Tue Feb 6 17:53:35 2018 +1100

    Fix broken composer when invoked from a mailto: link in a conversation.
    
    Bug 771504.
    
    * src/client/application/geary-controller.vala (GearyController): Invoke
      compose_mailto() from idle to avoid web process deadlock.

 src/client/application/geary-controller.vala |   27 +++++++++++++++++++------
 1 files changed, 20 insertions(+), 7 deletions(-)
---
diff --git a/src/client/application/geary-controller.vala b/src/client/application/geary-controller.vala
index f3972db..52dfe93 100644
--- a/src/client/application/geary-controller.vala
+++ b/src/client/application/geary-controller.vala
@@ -2744,13 +2744,7 @@ public class GearyController : Geary.BaseObject {
                 );
             });
         foreach (ConversationMessage msg_view in view) {
-            msg_view.link_activated.connect((link) => {
-                    if (link.down().has_prefix(Geary.ComposedEmail.MAILTO_SCHEME)) {
-                        compose_mailto(link);
-                    } else {
-                        open_uri(link);
-                    }
-                });
+            msg_view.link_activated.connect(on_link_activated);
             msg_view.save_image.connect((url, alt_text, buf) => {
                     on_save_image_extended(view, url, alt_text, buf);
                 });
@@ -2977,6 +2971,25 @@ public class GearyController : Geary.BaseObject {
         }
     }
 
+    private void on_link_activated(string uri) {
+        if (uri.down().has_prefix(Geary.ComposedEmail.MAILTO_SCHEME)) {
+            // We need to invoke this from idle to break the call
+            // chain from the WebKit signal which originally caused
+            // this handler to be invoked, otherwise the WebKit
+            // WebProcess will deadlock, and the resulting composer
+            // will be useless. See Geary Bug 771504
+            // <https://bugzilla.gnome.org/show_bug.cgi?id=771504>
+            // and WebKitGTK Bug 182528
+            // <https://bugs.webkit.org/show_bug.cgi?id=182528>
+            Idle.add(() => {
+                    compose_mailto(uri);
+                    return Source.REMOVE;
+                });
+        } else {
+            open_uri(uri);
+        }
+    }
+
     private void on_save_image_extended(ConversationEmail view,
                                         string url,
                                         string? alt_text,


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