[gnome-shell/gnome-40] keyboard: Ensure chrome input region is updated after slide animation



commit 821ff3bb887cfbbc080dc737b6084282213d0e7b
Author: Sebastian Keller <skeller gnome org>
Date:   Wed Aug 18 00:45:16 2021 +0200

    keyboard: Ensure chrome input region is updated after slide animation
    
    The keyboard is placed outside of the screen when shown and then slides
    in via a transition that changes the translate-y property. This
    translation does not affect the allocation of the Keyboard actor and as
    such does not trigger any of the signals LayoutManager is connected to
    to update the input region. This means the input region remains at the
    original position of the actor outside of the screen and as a result on
    X11 clicks will go through to the underlying window.
    
    There was a workaround for this by queuing a relayout at the end of the
    transition, but this stopped working due to optimizations avoiding
    unnecessary allocation changes.
    
    This updates that workaround to toggle the visibility of the actor
    instead, which is the other signal that LayoutManager reacts to. Once
    ClutterActor provides better ways to react to transforms this can
    hopefully be removed entirely.
    
    Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4556
    (cherry picked from commit 2ee323e37ee4fd3a7445ac3b12c8048ea3191546)
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1982>

 js/ui/keyboard.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index d0dde5b23a..8233fde859 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -1877,8 +1877,11 @@ var Keyboard = GObject.registerClass({
             this.translation_y = -this.height;
         });
 
-        // Queue a relayout so the keyboardBox can update its chrome region.
-        keyboardBox.queue_relayout();
+        // Toggle visibility so the keyboardBox can update its chrome region.
+        if (!Meta.is_wayland_compositor()) {
+            keyboardBox.hide();
+            keyboardBox.show();
+        }
     }
 
     _animateHide() {


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