[gnome-maps] contextMenu: Do not call Gtk code from Clutter event handler



commit 0b4ac9b014dcf3c7b7d75de92f6d90bb7bf8507e
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Mon Mar 16 17:50:46 2015 +0100

    contextMenu: Do not call Gtk code from Clutter event handler
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746128

 src/contextMenu.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/contextMenu.js b/src/contextMenu.js
index 6211bf2..094ec99 100644
--- a/src/contextMenu.js
+++ b/src/contextMenu.js
@@ -22,6 +22,7 @@
 
 const Clutter = imports.gi.Clutter;
 const Geocode = imports.gi.GeocodeGlib;
+const Mainloop = imports.mainloop;
 
 const Application = imports.application;
 const Lang = imports.lang;
@@ -51,7 +52,10 @@ const ContextMenu = new Lang.Class({
         this._latitude = this._mapView.view.y_to_latitude(y);
 
         if (button === Clutter.BUTTON_SECONDARY) {
-            this._menu.popup(null, null, null, button, event.get_time());
+            Mainloop.idle_add((function() {
+                // Need idle to avoid Clutter dead-lock on re-entrance
+                this._menu.popup(null, null, null, button, event.get_time());
+            }).bind(this));
         }
     },
 


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