From 79a1132780a1bdd7b093fe47a3f4cbbec049e310 Mon Sep 17 00:00:00 2001 From: dunconio Date: Sat, 13 Jul 2024 09:44:55 +0100 Subject: [PATCH 1/3] Add 'animation-exclude' to command line options (picom_options[]) --- src/options.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/options.c b/src/options.c index ca79b8d1f5..622bf2ffbe 100644 --- a/src/options.c +++ b/src/options.c @@ -192,6 +192,7 @@ static const struct picom_option picom_options[] = { {"animation-clamping" , no_argument , 809, NULL , "Enable/disable animation clamping. Disabling increases performance"}, {"animation-for-open-window" , required_argument, 810, NULL , "Set animation for opening window (Check sample.conf for options)."}, {"animation-for-transient-window", required_argument, 811, NULL , "Set animation for transient (child) windows."}, + {"animation-exclude" , required_argument, 812, NULL , "Specify a list of conditions of windows that should never be animated."}, }; // clang-format on From bfe3bd67c50eb521556b93c0732d1efa08aeec3e Mon Sep 17 00:00:00 2001 From: dunconio Date: Sat, 13 Jul 2024 13:19:40 +0100 Subject: [PATCH 2/3] Add missing animation command line options Add: * --animation-for-unmap-window * --animation-for-next-tag * --animation-for-prev-tag --- src/options.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/options.c b/src/options.c index 622bf2ffbe..2df92b4609 100644 --- a/src/options.c +++ b/src/options.c @@ -192,7 +192,10 @@ static const struct picom_option picom_options[] = { {"animation-clamping" , no_argument , 809, NULL , "Enable/disable animation clamping. Disabling increases performance"}, {"animation-for-open-window" , required_argument, 810, NULL , "Set animation for opening window (Check sample.conf for options)."}, {"animation-for-transient-window", required_argument, 811, NULL , "Set animation for transient (child) windows."}, - {"animation-exclude" , required_argument, 812, NULL , "Specify a list of conditions of windows that should never be animated."}, + {"animation-for-unmap-window" , required_argument, 812, NULL , "Set animation for unmap window (Check sample.conf for options)."}, + {"animation-for-next-tag" , required_argument, 813, NULL , "Set animation for next tag (Check sample.conf for options)."}, + {"animation-for-prev-tag" , required_argument, 814, NULL , "Set animation for previous tag (Check sample.conf for options)."}, + {"animation-exclude" , required_argument, 820, NULL , "Specify a list of conditions of windows that should never be animated."}, }; // clang-format on @@ -803,6 +806,36 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable, break; } case 812: { + // --animation-for-unmap-window + enum open_window_animation animation = parse_open_window_animation(optarg); + if (animation >= OPEN_WINDOW_ANIMATION_INVALID) { + log_warn("Invalid unmap-window animation %s, ignoring.", optarg); + } else { + opt->animation_for_unmap_window = animation; + } + break; + } + case 813: { + // --animation-for-next-tag + enum open_window_animation animation = parse_open_window_animation(optarg); + if (animation >= OPEN_WINDOW_ANIMATION_INVALID) { + log_warn("Invalid next-tag animation %s, ignoring.", optarg); + } else { + opt->animation_for_next_tag = animation; + } + break; + } + case 814: { + // --animation-for-prev-tag + enum open_window_animation animation = parse_open_window_animation(optarg); + if (animation >= OPEN_WINDOW_ANIMATION_INVALID) { + log_warn("Invalid prev-tag animation %s, ignoring.", optarg); + } else { + opt->animation_for_prev_tag = animation; + } + break; + } + case 820: { // --animation-exclude condlst_add(&opt->animation_blacklist, optarg); break; From 16e590d413249bf54c8c86bb5e3b01eb4c8b5a25 Mon Sep 17 00:00:00 2001 From: dunconio Date: Sat, 13 Jul 2024 13:25:29 +0100 Subject: [PATCH 3/3] Fix dwm 'tag change' conditions Since some time before dwm 6.1, dwm's showhide() function moves non-visible windows off-screen to -2 * width --- src/win.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/win.c b/src/win.c index 0b2aedeb8a..b720065479 100644 --- a/src/win.c +++ b/src/win.c @@ -696,9 +696,11 @@ void win_process_update_flags(session_t *ps, struct managed_win *w) { // Determine if a window should animate if (win_should_animate(ps, w)) { - if (w->pending_g.y < 0 && w->g.y > 0 && abs(w->pending_g.y - w->g.y) >= w->pending_g.height) + if ((w->pending_g.y < 0 && w->g.y > 0 && abs(w->pending_g.y - w->g.y) >= w->pending_g.height) || + (w->pending_g.x < 0 && w->g.x > 0 && abs(w->pending_g.x - w->g.x) >= w->pending_g.width)) w->dwm_mask = ANIM_PREV_TAG; - else if (w->pending_g.y > 0 && w->g.y < 0 && abs(w->pending_g.y - w->g.y) >= w->pending_g.height) + else if ((w->pending_g.y > 0 && w->g.y < 0 && abs(w->pending_g.y - w->g.y) >= w->pending_g.height) || + (w->pending_g.x > 0 && w->g.x < 0 && abs(w->pending_g.x - w->g.x) >= w->pending_g.width)) w->dwm_mask = ANIM_NEXT_TAG; if (!was_visible || w->dwm_mask) {