[gnome-shell] ScreenShield: wait for stage mapping before taking a grab



commit be290fafe7ff8abbecdeb760f8adc0de28466558
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Sep 4 20:47:20 2012 +0200

    ScreenShield: wait for stage mapping before taking a grab
    
    In gdm, we would attempt to become modal during the synchronous initialization,
    and this would fail, as X prevents grabs on unmapped windows. Instead,
    wait for the stage to be visible before becoming modal.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683357

 js/ui/screenShield.js |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 8f93e4a..21e0567 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -558,10 +558,16 @@ const ScreenShield = new Lang.Class({
     },
 
     showDialog: function() {
-        if (!this._isModal) {
-            Main.pushModal(this.actor);
-            this._isModal = true;
-        }
+        // Ensure that the stage window is mapped, before taking a grab
+        // otherwise X errors out
+        Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
+            if (!this._isModal) {
+                Main.pushModal(this.actor);
+                this._isModal = true;
+            }
+
+            return false;
+        }));
 
         this.actor.show();
         this._isGreeter = Main.sessionMode.isGreeter;



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