[gnome-shell/wip/carlosg/osk-gesture-feedback: 30/32] keyboard: Use translation-y property for focus window animations




commit 8526776b4a53d9a801197fb66ce9a282323c1c4e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Feb 12 00:53:21 2021 +0100

    keyboard: Use translation-y property for focus window animations
    
    Just the intermediate state, we still need to synchronize visual and
    real window position after the animation.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1668>

 js/ui/keyboard.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index a5304edace..ae3cdd35c2 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -1856,6 +1856,10 @@ var Keyboard = GObject.registerClass({
 
     _windowSlideAnimationComplete(window, delta) {
         // Synchronize window positions again.
+        const windowActor = window.get_compositor_private();
+        if (windowActor)
+            windowActor.translation_y = 0;
+
         let frameRect = window.get_frame_rect();
         frameRect.y += delta;
         window.move_frame(true, frameRect.x, frameRect.y);
@@ -1869,7 +1873,7 @@ var Keyboard = GObject.registerClass({
 
         if (show) {
             windowActor.ease({
-                y: windowActor.y - deltaY,
+                translation_y: -deltaY,
                 duration: KEYBOARD_ANIMATION_TIME,
                 mode: Clutter.AnimationMode.EASE_OUT_QUAD,
                 onComplete: () => {
@@ -1878,7 +1882,7 @@ var Keyboard = GObject.registerClass({
             });
         } else {
             windowActor.ease({
-                y: windowActor.y + deltaY,
+                translation_y: deltaY,
                 duration: KEYBOARD_ANIMATION_TIME,
                 mode: Clutter.AnimationMode.EASE_IN_QUAD,
                 onComplete: () => {


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