[gnome-shell] environment: Only disable unredirection of ongoing transitions



commit 38ad1d7c1393ca3be7ec1b6a9b02fc6bb2a3e658
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Oct 14 09:47:38 2019 +0200

    environment: Only disable unredirection of ongoing transitions
    
    When a transition is set up with a delay, it may be removed before it
    actually started. We won't get a ::stopped signal in that case, with
    the result that we currently end up with a mismatched unredirection
    disabling.
    
    Address this by only disable unredirection once the transition has
    actually started.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/1788

 js/ui/environment.js | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/environment.js b/js/ui/environment.js
index 38d1d281a6..bbd33c9654 100644
--- a/js/ui/environment.js
+++ b/js/ui/environment.js
@@ -109,8 +109,6 @@ function _easeActor(actor, params) {
         actor.set_easing_mode(params.mode);
     delete params.mode;
 
-    Meta.disable_unredirect_for_display(global.display);
-
     let cleanup = () => Meta.enable_unredirect_for_display(global.display);
     let callback = _makeEaseCallback(params, cleanup);
 
@@ -124,6 +122,11 @@ function _easeActor(actor, params) {
     let transition = animatedProps.map(p => actor.get_transition(p))
         .find(t => t !== null);
 
+    if (transition && transition.delay)
+        transition.connect('started', () => Meta.disable_unredirect_for_display(global.display));
+    else
+        Meta.disable_unredirect_for_display(global.display);
+
     if (transition)
         transition.connect('stopped', (t, finished) => callback(finished));
     else
@@ -145,8 +148,6 @@ function _easeActorProperty(actor, propName, target, params) {
     if (actor instanceof Clutter.Actor && !actor.mapped)
         duration = 0;
 
-    Meta.disable_unredirect_for_display(global.display);
-
     let cleanup = () => Meta.enable_unredirect_for_display(global.display);
     let callback = _makeEaseCallback(params, cleanup);
 
@@ -157,6 +158,7 @@ function _easeActorProperty(actor, propName, target, params) {
         let [obj, prop] = _getPropertyTarget(actor, propName);
         obj[prop] = target;
 
+        Meta.disable_unredirect_for_display(global.display);
         callback(true);
 
         return;
@@ -172,6 +174,11 @@ function _easeActorProperty(actor, propName, target, params) {
 
     transition.set_to(target);
 
+    if (transition.delay)
+        transition.connect('started', () => Meta.disable_unredirect_for_display(global.display));
+    else
+        Meta.disable_unredirect_for_display(global.display);
+
     transition.connect('stopped', (t, finished) => callback(finished));
 }
 


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