gnome-shell r121 - trunk/js/ui



Author: walters
Date: Fri Dec  5 21:50:09 2008
New Revision: 121
URL: http://svn.gnome.org/viewvc/gnome-shell?rev=121&view=rev

Log:
Use idle handler for overlay key binding

Running into odd problems with the overlay/windows key breaking, hopefully
this will work around those.

Modified:
   trunk/js/ui/main.js

Modified: trunk/js/ui/main.js
==============================================================================
--- trunk/js/ui/main.js	(original)
+++ trunk/js/ui/main.js	Fri Dec  5 21:50:09 2008
@@ -3,6 +3,7 @@
 const Clutter = imports.gi.Clutter;
 const Shell = imports.gi.Shell;
 const Signals = imports.signals;
+const Mainloop = imports.mainloop;
 const Tweener = imports.tweener.tweener;
 
 const Panel = imports.ui.panel;
@@ -123,11 +124,16 @@
     
     let display = global.screen.get_display();
     display.connect('overlay-key', function(display) {
-        if (overlay.visible) {
-            hide_overlay();
-        } else {
-            show_overlay();
-        }
+        // Queue an idle for this, because we're getting called
+        // out of a metacity event handler, and doing a lot of
+        // work from inside there is...iffy.
+        Mainloop.idle_add(function () {
+            if (overlay.visible) {
+                hide_overlay();
+            } else {
+                show_overlay();
+            }
+        });
     });
 }
 



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