From 0c037aea1e94a1a8ec6c2e329ccc8f06f6fe031c Mon Sep 17 00:00:00 2001 From: David Mohammed Date: Fri, 16 Oct 2020 22:23:36 +0100 Subject: [PATCH] Set x and y positions correctly for window animations --- debian/patches/windowanimation.patch | 54 +++++++++++++++++++++------- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/debian/patches/windowanimation.patch b/debian/patches/windowanimation.patch index 91a3f624e..97183322f 100644 --- a/debian/patches/windowanimation.patch +++ b/debian/patches/windowanimation.patch @@ -7,9 +7,11 @@ Bug: https://github.com/solus-project/budgie-desktop/issues/2040 Forwarded: TBD Last-Update: 2020-10-15 +Index: budgie-desktop-10.5.1+git20200824/src/wm/wm.vala +=================================================================== --- budgie-desktop-10.5.1+git20200824.orig/src/wm/wm.vala +++ budgie-desktop-10.5.1+git20200824/src/wm/wm.vala -@@ -112,20 +112,16 @@ public interface Switcher: GLib.Object +@@ -112,16 +112,20 @@ public interface Switcher: GLib.Object } public class MinimizeData { @@ -23,21 +25,30 @@ Last-Update: 2020-10-15 + public float scale_y; + public float anchor_x; + public float anchor_y; ++ public float place_x; ++ public float place_y; ++ public float old_x; ++ public float old_y; - public MinimizeData(double sx, double sy, double px, double py, double ox, double oy) { -+ public MinimizeData(float sx, float sy, float ax, float ay) { ++ public MinimizeData(float sx, float sy, float ax, float ay, float px, float py, float ox, float oy) { scale_x = sx; scale_y = sy; -- place_x = px; -- place_y = py; -- old_x = ox; -- old_y = oy; + anchor_x = ax; + anchor_y = ay; + place_x = px; + place_y = py; + old_x = ox; +@@ -820,7 +824,7 @@ public class BudgieWM : Meta.Plugin + finalize_animations(actor as Meta.WindowActor); } - } -@@ -851,19 +847,18 @@ public class BudgieWM : Meta.Plugin +- const int MINIMIZE_TIMEOUT = 195; ++ const int MINIMIZE_TIMEOUT = 225; + + public override void minimize(Meta.WindowActor actor) + { +@@ -851,19 +855,24 @@ public class BudgieWM : Meta.Plugin actor.transitions_completed.connect(minimize_done); /* Save the minimize state for later restoration */ @@ -51,22 +62,37 @@ Last-Update: 2020-10-15 + var scale_y = (float)(icon.height / actor.height); + var anchor_x = (float)(actor.x - icon.x) / (icon.width - actor.width); + var anchor_y = (float)(actor.y - icon.y) / (icon.height - actor.height); ++ var place_x = (float)icon.x; ++ var place_y = (float)icon.y; ++ var old_x = (float)actor.x; ++ var old_y = (float)actor.y; - MinimizeData d = new MinimizeData(scale_x, scale_y, place_x, place_y, old_x, old_y); -+ MinimizeData d = new MinimizeData(scale_x, scale_y, anchor_x, anchor_y); ++ MinimizeData d = new MinimizeData(scale_x, scale_y, anchor_x, anchor_y, place_x, place_y, old_x, old_y); actor.set_data("_minimize_data", d); - actor.set("opacity", 0U, "scale-gravity", Clutter.Gravity.NORTH_WEST, - "x", d.place_x, "y", d.place_y, "scale-x", - d.scale_x, "scale-y", d.scale_y); + actor.set_scale(d.scale_x, d.scale_y); ++ actor.set_x((float)icon.x); ++ actor.set_y((float)icon.y); + actor.opacity = 0U; + actor.set_content_gravity(Clutter.ContentGravity.TOP_LEFT); + actor.set_pivot_point(anchor_x, anchor_y); actor.restore_easing_state(); } -@@ -896,9 +891,9 @@ public class BudgieWM : Meta.Plugin +@@ -876,7 +885,7 @@ public class BudgieWM : Meta.Plugin + finalize_animations(actor as Meta.WindowActor); + } + +- const int UNMINIMIZE_TIMEOUT = 170; ++ const int UNMINIMIZE_TIMEOUT = 200; + + /** + * Handle unminimize animation +@@ -896,9 +905,11 @@ public class BudgieWM : Meta.Plugin finalize_animations(actor); @@ -75,11 +101,13 @@ Last-Update: 2020-10-15 - d.scale_x, "scale-y", d.scale_y); + actor.set_pivot_point (d.anchor_x, d.anchor_y); + actor.set_scale (d.scale_x, d.scale_y); ++ actor.set_x(d.place_x); ++ actor.set_y(d.place_y); + actor.opacity = 0U; actor.show(); -@@ -906,8 +901,8 @@ public class BudgieWM : Meta.Plugin +@@ -906,8 +917,10 @@ public class BudgieWM : Meta.Plugin actor.set_easing_mode(Clutter.AnimationMode.EASE_OUT_QUAD); actor.set_easing_duration(UNMINIMIZE_TIMEOUT); @@ -87,10 +115,12 @@ Last-Update: 2020-10-15 - "x", d.old_x, "y", d.old_y); + actor.set_scale (1.0f, 1.0f); + actor.opacity = 255U; ++ actor.set_x(d.old_x); ++ actor.set_y(d.old_y); actor.transitions_completed.connect(unminimize_done); state_map.insert(actor, AnimationState.UNMINIMIZE); -@@ -1193,8 +1188,8 @@ public class BudgieWM : Meta.Plugin +@@ -1193,8 +1206,8 @@ public class BudgieWM : Meta.Plugin } /* Return sorted list of user open tabs */