aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallusive-dev <[email protected]>2023-10-31 20:00:04 +1100
committerallusive-dev <[email protected]>2023-10-31 20:00:04 +1100
commit6af7735fbec073d4a7cf6193edad9e64f34f4984 (patch)
tree9c6218dd66f4d04e80c15948af60a00361b2a858
parentChange for #13 (diff)
downloadcompfy-1.2.0.tar.xz
compfy-1.2.0.zip
Resolved wrong animations playing. At the cost of deprecating not working features.1.2.0
-rw-r--r--src/backend/backend_common.h2
-rw-r--r--src/common.h6
-rw-r--r--src/config.c22
-rw-r--r--src/config.h14
-rw-r--r--src/config_libconfig.c84
-rw-r--r--src/event.c8
-rw-r--r--src/options.c22
-rw-r--r--src/picom.c98
-rw-r--r--src/win.c133
-rw-r--r--src/win.h2
10 files changed, 198 insertions, 193 deletions
diff --git a/src/backend/backend_common.h b/src/backend/backend_common.h
index c72a168..d4157bc 100644
--- a/src/backend/backend_common.h
+++ b/src/backend/backend_common.h
@@ -81,6 +81,8 @@ struct conv **generate_blur_kernel(enum blur_method method, void *args, int *ker
struct dual_kawase_params *generate_dual_kawase_params(void *args);
void *default_clone_image(backend_t *base, const void *image_data, const region_t *reg);
+void *default_resize_image(backend_t *base, const void *image_data, uint16_t desired_width,
+ uint16_t desired_height, const region_t *reg);
bool default_is_image_transparent(backend_t *base attr_unused, void *image_data);
bool default_set_image_property(backend_t *base attr_unused, enum image_properties op,
void *image_data, void *arg);
diff --git a/src/common.h b/src/common.h
index 809d4e5..aa33140 100644
--- a/src/common.h
+++ b/src/common.h
@@ -197,9 +197,9 @@ typedef struct session {
/// Width of root window.
int root_width;
/// Current desktop number of root window
- int root_desktop_num;
+ // int root_desktop_num;
/// Desktop switch direction
- int root_desktop_switch_direction;
+ // int root_desktop_switch_direction;
/// X Composite overlay window.
xcb_window_t overlay;
/// The target window for debug mode
@@ -258,7 +258,7 @@ typedef struct session {
/// Pre-generated alpha pictures.
xcb_render_picture_t *alpha_picts;
/// Time of last fading. In milliseconds.
- long long fade_time;
+ long fade_time;
/// Time of last window animation step. In milliseconds.
long animation_time;
/// Head pointer of the error ignore linked list.
diff --git a/src/config.c b/src/config.c
index 2ae855b..605cde8 100644
--- a/src/config.c
+++ b/src/config.c
@@ -746,14 +746,14 @@ void set_default_winopts(options_t *opt, win_option_mask_t *mask, bool shadow_en
mask[i].animation_unmap = OPEN_WINDOW_ANIMATION_INVALID;
opt->wintype_option[i].animation_unmap = OPEN_WINDOW_ANIMATION_INVALID;
}
- if (!mask[i].animation_workspace_in) {
- mask[i].animation_workspace_in = OPEN_WINDOW_ANIMATION_INVALID;
- opt->wintype_option[i].animation_workspace_in = OPEN_WINDOW_ANIMATION_INVALID;
- }
- if (!mask[i].animation_workspace_out) {
- mask[i].animation_workspace_out = OPEN_WINDOW_ANIMATION_INVALID;
- opt->wintype_option[i].animation_workspace_out = OPEN_WINDOW_ANIMATION_INVALID;
- }
+ // if (!mask[i].animation_workspace_in) {
+ // mask[i].animation_workspace_in = OPEN_WINDOW_ANIMATION_INVALID;
+ // opt->wintype_option[i].animation_workspace_in = OPEN_WINDOW_ANIMATION_INVALID;
+ // }
+ // if (!mask[i].animation_workspace_out) {
+ // mask[i].animation_workspace_out = OPEN_WINDOW_ANIMATION_INVALID;
+ // opt->wintype_option[i].animation_workspace_out = OPEN_WINDOW_ANIMATION_INVALID;
+ // }
if (!mask[i].clip_shadow_above) {
mask[i].clip_shadow_above = true;
opt->wintype_option[i].clip_shadow_above = false;
@@ -830,10 +830,10 @@ char *parse_config(options_t *opt, const char *config_file, bool *shadow_enable,
.animations = true,
.animation_for_open_window = OPEN_WINDOW_ANIMATION_ZOOM,
- .animation_for_transient_window = OPEN_WINDOW_ANIMATION_ZOOM,
+ // .animation_for_transient_window = OPEN_WINDOW_ANIMATION_NONE,
.animation_for_unmap_window = OPEN_WINDOW_ANIMATION_ZOOM,
- .animation_for_workspace_switch_in = OPEN_WINDOW_ANIMATION_ZOOM,
- .animation_for_workspace_switch_out = OPEN_WINDOW_ANIMATION_ZOOM,
+ // .animation_for_workspace_switch_in = OPEN_WINDOW_ANIMATION_NONE,
+ // .animation_for_workspace_switch_out = OPEN_WINDOW_ANIMATION_NONE,
.animation_stiffness = 100.0,
.animation_window_mass = 0.5,
.animation_dampening = 10,
diff --git a/src/config.h b/src/config.h
index b2d3958..2664435 100644
--- a/src/config.h
+++ b/src/config.h
@@ -49,8 +49,8 @@ enum open_window_animation {
OPEN_WINDOW_ANIMATION_SLIDE_DOWN,
OPEN_WINDOW_ANIMATION_SLIDE_LEFT,
OPEN_WINDOW_ANIMATION_SLIDE_RIGHT,
- OPEN_WINDOW_ANIMATION_SLIDE_IN,
- OPEN_WINDOW_ANIMATION_SLIDE_OUT,
+ // OPEN_WINDOW_ANIMATION_SLIDE_IN,
+ // OPEN_WINDOW_ANIMATION_SLIDE_OUT,
OPEN_WINDOW_ANIMATION_INVALID,
};
@@ -65,8 +65,8 @@ typedef struct win_option_mask {
bool clip_shadow_above : 1;
enum open_window_animation animation;
enum open_window_animation animation_unmap;
- enum open_window_animation animation_workspace_in;
- enum open_window_animation animation_workspace_out;
+ // enum open_window_animation animation_workspace_in;
+ // enum open_window_animation animation_workspace_out;
} win_option_mask_t;
typedef struct win_option {
@@ -200,14 +200,14 @@ typedef struct options {
/// Which animation to run when opening a window
enum open_window_animation animation_for_open_window;
/// Which animation to run when opening a transient window
- enum open_window_animation animation_for_transient_window;
+ // enum open_window_animation animation_for_transient_window;
/// Which animation to run when unmapping (e.g. minimizing) a window
enum open_window_animation animation_for_unmap_window;
/// Which animation to run when switching workspace
/// IMPORTANT: will only work if window manager updates
/// _NET_CURRENT_DESKTOP before doing the hide/show of windows
- enum open_window_animation animation_for_workspace_switch_in;
- enum open_window_animation animation_for_workspace_switch_out;
+ // enum open_window_animation animation_for_workspace_switch_in;
+ // enum open_window_animation animation_for_workspace_switch_out;
/// Spring stiffness for animation
double animation_stiffness;
/// Window mass for animation
diff --git a/src/config_libconfig.c b/src/config_libconfig.c
index 0df975b..02db3ef 100644
--- a/src/config_libconfig.c
+++ b/src/config_libconfig.c
@@ -269,22 +269,22 @@ static inline void parse_wintype_config(const config_t *cfg, const char *member_
o->animation_unmap = animation;
mask->animation_unmap = OPEN_WINDOW_ANIMATION_INVALID;
}
- if (config_setting_lookup_string(setting, "animation-workspace-in", &sval)) {
- enum open_window_animation animation = parse_open_window_animation(sval);
- if (animation >= OPEN_WINDOW_ANIMATION_INVALID)
- animation = OPEN_WINDOW_ANIMATION_NONE;
-
- o->animation_workspace_in = animation;
- mask->animation_workspace_in = OPEN_WINDOW_ANIMATION_INVALID;
- }
- if (config_setting_lookup_string(setting, "animation-workspace-out", &sval)) {
- enum open_window_animation animation = parse_open_window_animation(sval);
- if (animation >= OPEN_WINDOW_ANIMATION_INVALID)
- animation = OPEN_WINDOW_ANIMATION_NONE;
-
- o->animation_workspace_out = animation;
- mask->animation_workspace_out = OPEN_WINDOW_ANIMATION_INVALID;
- }
+ // if (config_setting_lookup_string(setting, "animation-workspace-in", &sval)) {
+ // enum open_window_animation animation = parse_open_window_animation(sval);
+ // if (animation >= OPEN_WINDOW_ANIMATION_INVALID)
+ // animation = OPEN_WINDOW_ANIMATION_NONE;
+
+ // o->animation_workspace_in = animation;
+ // mask->animation_workspace_in = OPEN_WINDOW_ANIMATION_INVALID;
+ // }
+ // if (config_setting_lookup_string(setting, "animation-workspace-out", &sval)) {
+ // enum open_window_animation animation = parse_open_window_animation(sval);
+ // if (animation >= OPEN_WINDOW_ANIMATION_INVALID)
+ // animation = OPEN_WINDOW_ANIMATION_NONE;
+
+ // o->animation_workspace_out = animation;
+ // mask->animation_workspace_out = OPEN_WINDOW_ANIMATION_INVALID;
+ // }
double fval;
if (config_setting_lookup_float(setting, "opacity", &fval)) {
@@ -532,14 +532,14 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
opt->animation_for_open_window = animation;
}
// --animation-for-transient-window
- if (config_lookup_string(&cfg, "animation-for-transient-window", &sval)) {
- enum open_window_animation animation = parse_open_window_animation(sval);
- if (animation >= OPEN_WINDOW_ANIMATION_INVALID) {
- log_fatal("Invalid transient-window animation %s", sval);
- goto err;
- }
- opt->animation_for_transient_window = animation;
- }
+ // if (config_lookup_string(&cfg, "animation-for-transient-window", &sval)) {
+ // enum open_window_animation animation = parse_open_window_animation(sval);
+ // if (animation >= OPEN_WINDOW_ANIMATION_INVALID) {
+ // log_fatal("Invalid transient-window animation %s", sval);
+ // goto err;
+ // }
+ // opt->animation_for_transient_window = animation;
+ // }
// --animation-for-unmap-window
if (config_lookup_string(&cfg, "animation-for-unmap-window", &sval)) {
enum open_window_animation animation = parse_open_window_animation(sval);
@@ -549,24 +549,24 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
}
opt->animation_for_unmap_window = animation;
}
- // --animation-for-workspace-switch-in
- if (config_lookup_string(&cfg, "animation-for-workspace-switch-in", &sval)) {
- enum open_window_animation animation = parse_open_window_animation(sval);
- if (animation >= OPEN_WINDOW_ANIMATION_INVALID) {
- log_fatal("Invalid workspace-switch-in animation %s", sval);
- goto err;
- }
- opt->animation_for_workspace_switch_in = animation;
- }
- // --animation-for-workspace-switch-out
- if (config_lookup_string(&cfg, "animation-for-workspace-switch-out", &sval)) {
- enum open_window_animation animation = parse_open_window_animation(sval);
- if (animation >= OPEN_WINDOW_ANIMATION_INVALID) {
- log_fatal("Invalid workspace-switch-out animation %s", sval);
- goto err;
- }
- opt->animation_for_workspace_switch_out = animation;
- }
+ // // --animation-for-workspace-switch-in
+ // if (config_lookup_string(&cfg, "animation-for-workspace-switch-in", &sval)) {
+ // enum open_window_animation animation = parse_open_window_animation(sval);
+ // if (animation >= OPEN_WINDOW_ANIMATION_INVALID) {
+ // log_fatal("Invalid workspace-switch-in animation %s", sval);
+ // goto err;
+ // }
+ // opt->animation_for_workspace_switch_in = animation;
+ // }
+ // // --animation-for-workspace-switch-out
+ // if (config_lookup_string(&cfg, "animation-for-workspace-switch-out", &sval)) {
+ // enum open_window_animation animation = parse_open_window_animation(sval);
+ // if (animation >= OPEN_WINDOW_ANIMATION_INVALID) {
+ // log_fatal("Invalid workspace-switch-out animation %s", sval);
+ // goto err;
+ // }
+ // opt->animation_for_workspace_switch_out = animation;
+ // }
// --animation-stiffness
config_lookup_float(&cfg, "animation-stiffness", &opt->animation_stiffness);
// --animation-window-mass
diff --git a/src/event.c b/src/event.c
index beec195..e42001e 100644
--- a/src/event.c
+++ b/src/event.c
@@ -454,10 +454,10 @@ static inline void ev_property_notify(session_t *ps, xcb_property_notify_event_t
auto prop = x_get_prop(ps->c, ps->root, ps->atoms->a_NET_CURRENT_DESKTOP,
1L, XCB_ATOM_CARDINAL, 32);
- if (prop.nitems) {
- ps->root_desktop_switch_direction = ((int)*prop.c32) - ps->root_desktop_num;
- ps->root_desktop_num = (int)*prop.c32;
- }
+ // if (prop.nitems) {
+ // ps->root_desktop_switch_direction = ((int)*prop.c32) - ps->root_desktop_num;
+ // ps->root_desktop_num = (int)*prop.c32;
+ // }
}
if (ps->o.use_ewmh_active_win && ps->atoms->a_NET_ACTIVE_WINDOW == ev->atom) {
diff --git a/src/options.c b/src/options.c
index c102042..c3eccab 100644
--- a/src/options.c
+++ b/src/options.c
@@ -181,7 +181,7 @@ static const struct picom_option picom_options[] = {
{"animation-window-mass", required_argument, 807, NULL, "window mass"},
{"animation-clamping", no_argument, 808, NULL, "clamping"},
{"animation-for-open-window", required_argument, 809, NULL, "open window animation"},
- {"animation-for-transient-window", required_argument, 810, NULL, "transient window animation"},
+ // {"animation-for-transient-window", required_argument, 810, NULL, "transient window animation"},
{"animation-for-unmap-window", required_argument, 811, NULL, "unmap window animation"},
{"corners-rule", required_argument, NULL, 812, "rounded corner rules"},
{"blur-rule", required_argument, NULL, 813, "blur rules"},
@@ -762,16 +762,16 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
}
break;
}
- case 810: {
- // --animation-for-transient-window
- enum open_window_animation animation = parse_open_window_animation(optarg);
- if (animation >= OPEN_WINDOW_ANIMATION_INVALID) {
- log_warn("Invalid transient-window animation %s, ignoring.", optarg);
- } else {
- opt->animation_for_transient_window = animation;
- }
- break;
- }
+ // case 810: {
+ // // --animation-for-transient-window
+ // enum open_window_animation animation = parse_open_window_animation(optarg);
+ // if (animation >= OPEN_WINDOW_ANIMATION_INVALID) {
+ // log_warn("Invalid transient-window animation %s, ignoring.", optarg);
+ // } else {
+ // opt->animation_for_transient_window = animation;
+ // }
+ // break;
+ // }
case 811: {
// --animation-for-unmap-window
enum open_window_animation animation = parse_open_window_animation(optarg);
diff --git a/src/picom.c b/src/picom.c
index 980655d..bf49361 100644
--- a/src/picom.c
+++ b/src/picom.c
@@ -610,10 +610,10 @@ static void configure_root(session_t *ps) {
auto prop = x_get_prop(ps->c, ps->root, ps->atoms->a_NET_CURRENT_DESKTOP,
1L, XCB_ATOM_CARDINAL, 32);
- ps->root_desktop_switch_direction = 0;
- if (prop.nitems) {
- ps->root_desktop_num = (int)*prop.c32;
- }
+ // ps->root_desktop_switch_direction = 0;
+ // if (prop.nitems) {
+ // ps->root_desktop_num = (int)*prop.c32;
+ // }
rebuild_screen_reg(ps);
rebuild_shadow_exclude_reg(ps);
@@ -861,26 +861,26 @@ paint_preprocess(session_t *ps, bool *fade_running, bool *animation_running) {
w->animation_velocity_h = 0.0;
}
- if (!ps->root_desktop_switch_direction) {
- if (w->state == WSTATE_UNMAPPING || w->state == WSTATE_DESTROYING) {
- steps = 0;
- double new_opacity = clamp(
- w->opacity_target_old-w->animation_progress,
- w->opacity_target, 1);
+ // if (!ps->root_desktop_switch_direction) {
+ // if (w->state == WSTATE_UNMAPPING || w->state == WSTATE_DESTROYING) {
+ // steps = 0;
+ // double new_opacity = clamp(
+ // w->opacity_target_old-w->animation_progress,
+ // w->opacity_target, 1);
- if (new_opacity < w->opacity)
- w->opacity = new_opacity;
+ // if (new_opacity < w->opacity)
+ // w->opacity = new_opacity;
- } else if (w->state == WSTATE_MAPPING) {
- steps = 0;
- double new_opacity = clamp(
- w->animation_progress,
- 0.0, w->opacity_target);
+ // } else if (w->state == WSTATE_MAPPING) {
+ // steps = 0;
+ // double new_opacity = clamp(
+ // w->animation_progress,
+ // 0.0, w->opacity_target);
- if (new_opacity > w->opacity)
- w->opacity = new_opacity;
- }
- }
+ // if (new_opacity > w->opacity)
+ // w->opacity = new_opacity;
+ // }
+ // }
*animation_running = true;
}
@@ -895,37 +895,39 @@ paint_preprocess(session_t *ps, bool *fade_running, bool *animation_running) {
*animation_running = true;
}
- // Run fading
- if (run_fade(ps, &w, steps)) {
- *fade_running = true;
- }
+ if (w->opacity != w->opacity_target) {
+ // Run fading
+ if (run_fade(ps, &w, steps)) {
+ *fade_running = true;
+ }
- // Add window to damaged area if its opacity changes
- // If was_painted == false, and to_paint is also false, we don't care
- // If was_painted == false, but to_paint is true, damage will be added in
- // the loop below
- if (was_painted && w->opacity != opacity_old) {
- add_damage_from_win(ps, w);
- }
+ // Add window to damaged area if its opacity changes
+ // If was_painted == false, and to_paint is also false, we don't care
+ // If was_painted == false, but to_paint is true, damage will be added in
+ // the loop below
+ if (was_painted && w->opacity != opacity_old) {
+ add_damage_from_win(ps, w);
+ }
- if (win_check_fade_finished(ps, w)) {
- // the window has been destroyed because fading finished
- continue;
- }
+ if (win_check_fade_finished(ps, w)) {
+ // the window has been destroyed because fading finished
+ continue;
+ }
- if (win_has_frame(w)) {
- w->frame_opacity = ps->o.frame_opacity;
- } else {
- w->frame_opacity = 1.0;
- }
+ if (win_has_frame(w)) {
+ w->frame_opacity = ps->o.frame_opacity;
+ } else {
+ w->frame_opacity = 1.0;
+ }
- // Update window mode
- w->mode = win_calc_mode(w);
+ // Update window mode
+ w->mode = win_calc_mode(w);
- // Destroy all reg_ignore above when frame opaque state changes on
- // SOLID mode
- if (was_painted && w->mode != mode_old) {
- w->reg_ignore_valid = false;
+ // Destroy all reg_ignore above when frame opaque state changes on
+ // SOLID mode
+ if (was_painted && w->mode != mode_old) {
+ w->reg_ignore_valid = false;
+ }
}
}
@@ -1747,7 +1749,7 @@ static void draw_callback_impl(EV_P_ session_t *ps, int revents attr_unused) {
}
if (!animation_running) {
ps->animation_time = 0L;
- ps->root_desktop_switch_direction = 0;
+ // ps->root_desktop_switch_direction = 0;
}
// TODO(yshui) Investigate how big the X critical section needs to be. There are
diff --git a/src/win.c b/src/win.c
index a0f877a..929d5c1 100644
--- a/src/win.c
+++ b/src/win.c
@@ -474,20 +474,21 @@ static void win_update_properties(session_t *ps, struct managed_win *w) {
static void init_animation(session_t *ps, struct managed_win *w) {
enum open_window_animation animation = ps->o.animation_for_open_window;
- w->animation_transient = wid_has_prop(ps, w->client_win, ps->atoms->aWM_TRANSIENT_FOR);
+ // w->animation_transient = wid_has_prop(ps, w->client_win, ps->atoms->aWM_TRANSIENT_FOR);
// if (w->window_type != WINTYPE_TOOLTIP && w->animation_transient)
- // animation = ps->o.animation_for_transient_window;
+ // animation = ps->o.animation_for_open_window;
if (ps->o.wintype_option[w->window_type].animation < OPEN_WINDOW_ANIMATION_INVALID)
animation = ps->o.wintype_option[w->window_type].animation;
- if (ps->root_desktop_switch_direction != 0) {
- if (ps->o.animation_for_workspace_switch_in == OPEN_WINDOW_ANIMATION_AUTO)
- animation = OPEN_WINDOW_ANIMATION_SLIDE_IN;
- else
- animation = ps->o.animation_for_workspace_switch_in;
- }
+ // if (ps->root_desktop_switch_direction != 0) {
+ // if (ps->o.animation_for_workspace_switch_in == OPEN_WINDOW_ANIMATION_AUTO) {
+ // animation = OPEN_WINDOW_ANIMATION_SLIDE_IN;
+ // } else {
+ // animation = ps->o.animation_for_workspace_switch_in;
+ // }
+ // }
if (c2_match(ps, w, ps->o.animation_open_blacklist, NULL)) {
animation = OPEN_WINDOW_ANIMATION_NONE;
@@ -550,28 +551,28 @@ static void init_animation(session_t *ps, struct managed_win *w) {
w->animation_h = w->pending_g.height;
break;
}
- case OPEN_WINDOW_ANIMATION_SLIDE_IN: {
- w->animation_center_x = w->pending_g.x + w->pending_g.width * 0.5;
- w->animation_center_y = w->pending_g.y + w->pending_g.height * 0.5 -
- ps->root_height *
- ((ps->root_desktop_switch_direction < 0 &&
- ps->root_desktop_switch_direction >= -1) ||
- ps->root_desktop_switch_direction > 1?1:-1);
- w->animation_w = w->pending_g.width;
- w->animation_h = w->pending_g.height;
- break;
- }
- case OPEN_WINDOW_ANIMATION_SLIDE_OUT: {
- 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 -
- ps->root_height *
- ((ps->root_desktop_switch_direction < 0 &&
- ps->root_desktop_switch_direction >= -1) ||
- ps->root_desktop_switch_direction > 1?-1:1);
- w->animation_dest_w = w->pending_g.width;
- w->animation_dest_h = w->pending_g.height;
- break;
- }
+ // case OPEN_WINDOW_ANIMATION_SLIDE_IN: {
+ // w->animation_center_x = w->pending_g.x + w->pending_g.width * 0.5;
+ // w->animation_center_y = w->pending_g.y + w->pending_g.height * 0.5 -
+ // ps->root_height *
+ // ((ps->root_desktop_switch_direction < 0 &&
+ // ps->root_desktop_switch_direction >= -1) ||
+ // ps->root_desktop_switch_direction > 1?1:-1);
+ // w->animation_w = w->pending_g.width;
+ // w->animation_h = w->pending_g.height;
+ // break;
+ // }
+ // case OPEN_WINDOW_ANIMATION_SLIDE_OUT: {
+ // 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 -
+ // ps->root_height *
+ // ((ps->root_desktop_switch_direction < 0 &&
+ // ps->root_desktop_switch_direction >= -1) ||
+ // ps->root_desktop_switch_direction > 1?-1:1);
+ // w->animation_dest_w = w->pending_g.width;
+ // w->animation_dest_h = w->pending_g.height;
+ // break;
+ // }
case OPEN_WINDOW_ANIMATION_INVALID: assert(false); break;
}
}
@@ -582,8 +583,8 @@ static void init_animation_unmap(session_t *ps, struct managed_win *w) {
if (ps->o.animation_for_unmap_window == OPEN_WINDOW_ANIMATION_AUTO) {
animation = ps->o.animation_for_open_window;
- if (w->window_type != WINTYPE_TOOLTIP && w->animation_transient)
- animation = ps->o.animation_for_unmap_window;
+ // if (w->window_type != WINTYPE_TOOLTIP && w->animation_transient)
+ // animation = ps->o.animation_for_unmap_window;
if (ps->o.wintype_option[w->window_type].animation < OPEN_WINDOW_ANIMATION_INVALID)
animation = ps->o.wintype_option[w->window_type].animation;
@@ -596,10 +597,10 @@ static void init_animation_unmap(session_t *ps, struct managed_win *w) {
animation = OPEN_WINDOW_ANIMATION_SLIDE_RIGHT;
else if (animation == OPEN_WINDOW_ANIMATION_SLIDE_RIGHT)
animation = OPEN_WINDOW_ANIMATION_SLIDE_LEFT;
- else if (animation == OPEN_WINDOW_ANIMATION_SLIDE_IN)
- animation = OPEN_WINDOW_ANIMATION_SLIDE_OUT;
- else if (animation == OPEN_WINDOW_ANIMATION_SLIDE_OUT)
- animation = OPEN_WINDOW_ANIMATION_SLIDE_IN;
+ // else if (animation == OPEN_WINDOW_ANIMATION_SLIDE_IN)
+ // animation = OPEN_WINDOW_ANIMATION_SLIDE_OUT;
+ // else if (animation == OPEN_WINDOW_ANIMATION_SLIDE_OUT)
+ // animation = OPEN_WINDOW_ANIMATION_SLIDE_IN;
} else {
animation = ps->o.animation_for_unmap_window;
@@ -608,12 +609,12 @@ static void init_animation_unmap(session_t *ps, struct managed_win *w) {
animation = ps->o.wintype_option[w->window_type].animation_unmap;
}
- if (ps->root_desktop_switch_direction != 0) {
- if (ps->o.animation_for_workspace_switch_out == OPEN_WINDOW_ANIMATION_AUTO)
- animation = OPEN_WINDOW_ANIMATION_SLIDE_OUT;
- else
- animation = ps->o.animation_for_workspace_switch_out;
- }
+ // if (ps->root_desktop_switch_direction != 0) {
+ // if (ps->o.animation_for_workspace_switch_out == OPEN_WINDOW_ANIMATION_AUTO)
+ // animation = OPEN_WINDOW_ANIMATION_SLIDE_OUT;
+ // else
+ // animation = ps->o.animation_for_workspace_switch_out;
+ // }
if (c2_match(ps, w, ps->o.animation_unmap_blacklist, NULL)) {
animation = OPEN_WINDOW_ANIMATION_NONE;
@@ -676,28 +677,28 @@ static void init_animation_unmap(session_t *ps, struct managed_win *w) {
w->animation_dest_h = w->pending_g.height;
break;
}
- case OPEN_WINDOW_ANIMATION_SLIDE_IN: {
- w->animation_center_x = w->pending_g.x + w->pending_g.width * 0.5;
- w->animation_center_y = w->pending_g.y + w->pending_g.height * 0.5 -
- ps->root_height *
- ((ps->root_desktop_switch_direction < 0 &&
- ps->root_desktop_switch_direction >= -1) ||
- ps->root_desktop_switch_direction > 1?1:-1);
- w->animation_w = w->pending_g.width;
- w->animation_h = w->pending_g.height;
- break;
- }
- case OPEN_WINDOW_ANIMATION_SLIDE_OUT: {
- 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 -
- ps->root_height *
- ((ps->root_desktop_switch_direction < 0 &&
- ps->root_desktop_switch_direction >= -1) ||
- ps->root_desktop_switch_direction > 1?-1:1);
- w->animation_dest_w = w->pending_g.width;
- w->animation_dest_h = w->pending_g.height;
- break;
- }
+ // case OPEN_WINDOW_ANIMATION_SLIDE_IN: {
+ // w->animation_center_x = w->pending_g.x + w->pending_g.width * 0.5;
+ // w->animation_center_y = w->pending_g.y + w->pending_g.height * 0.5 -
+ // ps->root_height *
+ // ((ps->root_desktop_switch_direction < 0 &&
+ // ps->root_desktop_switch_direction >= -1) ||
+ // ps->root_desktop_switch_direction > 1?1:-1);
+ // w->animation_w = w->pending_g.width;
+ // w->animation_h = w->pending_g.height;
+ // break;
+ // }
+ // case OPEN_WINDOW_ANIMATION_SLIDE_OUT: {
+ // 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 -
+ // ps->root_height *
+ // ((ps->root_desktop_switch_direction < 0 &&
+ // ps->root_desktop_switch_direction >= -1) ||
+ // ps->root_desktop_switch_direction > 1?-1:1);
+ // w->animation_dest_w = w->pending_g.width;
+ // w->animation_dest_h = w->pending_g.height;
+ // break;
+ // }
case OPEN_WINDOW_ANIMATION_INVALID: assert(false); break;
}
}
@@ -1120,8 +1121,8 @@ double win_calc_opacity_target(session_t *ps, const struct managed_win *w) {
return 0;
}
if (w->state == WSTATE_UNMAPPING || w->state == WSTATE_DESTROYING) {
- if (ps->root_desktop_switch_direction)
- return w->opacity;
+ // if (ps->root_desktop_switch_direction)
+ // return w->opacity;
return 0;
}
diff --git a/src/win.h b/src/win.h
index 9a27c4c..1d0fae8 100644
--- a/src/win.h
+++ b/src/win.h
@@ -176,7 +176,7 @@ struct managed_win {
bool in_openclose;
/// Whether this window was transient when animated on open
- bool animation_transient;
+ // bool animation_transient;
/// Current position and destination, for animation
double animation_center_x, animation_center_y;
double animation_dest_center_x, animation_dest_center_y;