[gnome-shell] overview: Sync grabs after running startup animation



commit 954131c1c8a58a87d597270f357b0d0c7556662c
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Thu Apr 15 16:58:17 2021 +0200

    overview: Sync grabs after running startup animation
    
    In the nested session the startup animation sometimes fails, weirdly
    that always happens to me when running a freshly built gnome-shell the
    first time. The reason it fails is that mutter fails to aquire a pointer
    grab from the xserver, XIGrabDevice() is unsuccessful.
    
    A simple workaround for this race condition in the xserver is to just
    grab the devices a bit later, that is after the startups animation
    instead of before it.
    
    This was also tested with disabled animations, and seems to work just as
    well in that case.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1812>

 js/ui/overview.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index ca5de0c226..e6b3b26156 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -649,13 +649,20 @@ var Overview = class {
         this._visible = true;
         this._visibleTarget = true;
         Main.layoutManager.showOverview();
-        this._syncGrab();
+        // We should call this._syncGrab() here, but moved it to happen after
+        // the animation because of a race in the xserver where the grab
+        // fails when requested very early during startup.
 
         Meta.disable_unredirect_for_display(global.display);
 
         this.emit('showing');
 
         this._overview.runStartupAnimation(() => {
+            if (!this._syncGrab()) {
+                callback();
+                return;
+            }
+
             Main.panel.style = null;
             this.emit('shown');
             callback();


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