aboutsummaryrefslogtreecommitdiff
path: root/src/win.c
diff options
context:
space:
mode:
authorAllusive <[email protected]>2023-11-08 14:53:27 +1100
committerGitHub <[email protected]>2023-11-08 14:53:27 +1100
commit9efbdea90442c954ad8f13e26fa62d3289da652e (patch)
treece3d50079374618bdcf1e40692bcf4ec4f36d984 /src/win.c
parentTesting Issue #23 (diff)
parentDon't animate hlwm tab switches (working #23 fix) (diff)
downloadcompfy-9efbdea90442c954ad8f13e26fa62d3289da652e.tar.xz
compfy-9efbdea90442c954ad8f13e26fa62d3289da652e.zip
Merge pull request #26 from xrun1/main1.3.3
Don't animate hlwm tab switches (working #23 fix)
Diffstat (limited to 'src/win.c')
-rw-r--r--src/win.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/src/win.c b/src/win.c
index 80ef89f..73710f7 100644
--- a/src/win.c
+++ b/src/win.c
@@ -766,26 +766,22 @@ void win_process_update_flags(session_t *ps, struct managed_win *w) {
w->g.height = (uint16_t)round(w->animation_h);
} else {
- if (ps->o.support_for_wm == WM_SUPPORT_HERB) {
-
- if (w->pending_g.x < -(w->g.width) && w->pending_g.y < -(w->g.height)) {
- log_warn("Animation geometry postion update cancelled");
- } else {
- w->animation_dest_center_x =
- w->pending_g.x + w->pending_g.width * 0.5;
- w->animation_dest_center_y =
- w->pending_g.y + w->pending_g.height * 0.5;
- w->animation_dest_w = w->pending_g.width;
- w->animation_dest_h = w->pending_g.height;
- }
- } else {
- w->animation_dest_center_x =
- w->pending_g.x + w->pending_g.width * 0.5;
- w->animation_dest_center_y =
- w->pending_g.y + w->pending_g.height * 0.5;
- w->animation_dest_w = w->pending_g.width;
- w->animation_dest_h = w->pending_g.height;
- }
+ w->animation_dest_center_x =
+ w->pending_g.x + w->pending_g.width * 0.5;
+ w->animation_dest_center_y =
+ w->pending_g.y + w->pending_g.height * 0.5;
+
+ bool herb = ps->o.support_for_wm == WM_SUPPORT_HERB;
+ bool hidingTab = w->pending_g.x < -(w->g.width) && w->pending_g.y < -(w->g.height);
+ bool unhidingTab = w->g.x < -(w->g.width) && w->g.y < -(w->g.height);
+
+ if (herb && (hidingTab || unhidingTab)) {
+ w->animation_center_x = w->animation_dest_center_x;
+ w->animation_center_y = w->animation_dest_center_y;
+ };
+
+ w->animation_dest_w = w->pending_g.width;
+ w->animation_dest_h = w->pending_g.height;
}
w->g.border_width = w->pending_g.border_width;