shadow fix
This commit is contained in:
@@ -497,7 +497,7 @@ void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) {
|
||||
}
|
||||
|
||||
// Draw window on target
|
||||
bool is_animating = 0 <= w->animation_progress && w->animation_progress < 1.0;
|
||||
bool is_animating = 0 < w->animation_progress && w->animation_progress < 1.0;
|
||||
if (w->frame_opacity == 1 && !is_animating) {
|
||||
ps->backend_data->ops->compose(ps->backend_data, w->win_image,
|
||||
window_coord, NULL, dest_coord,
|
||||
|
||||
@@ -688,7 +688,7 @@ paint_preprocess(session_t *ps, bool *fade_running, bool *animation_running) {
|
||||
// IMPORTANT: These window animation steps must happen before any other
|
||||
// [pre]processing. This is because it changes the window's geometry.
|
||||
if (ps->o.animations &&
|
||||
!isnan(w->animation_progress) && w->animation_progress != 1.0 &&
|
||||
!isnan(w->animation_progress) && w->animation_progress <= 0.999999999 &&
|
||||
ps->o.wintype_option[w->window_type].animation != 0 &&
|
||||
win_is_mapped_in_x(w))
|
||||
{
|
||||
@@ -842,14 +842,14 @@ paint_preprocess(session_t *ps, bool *fade_running, bool *animation_running) {
|
||||
// We can't check for 1 here as sometimes 1 = 0.999999999999999
|
||||
// in case of floating numbers
|
||||
if (w->animation_progress >= 0.999999999) {
|
||||
win_process_update_flags(ps, w);
|
||||
w->animation_progress = 1;
|
||||
w->animation_velocity_x = 0.0;
|
||||
w->animation_velocity_y = 0.0;
|
||||
w->animation_velocity_w = 0.0;
|
||||
w->animation_velocity_h = 0.0;
|
||||
w->opacity = win_calc_opacity_target(ps, w);
|
||||
w->opacity = win_calc_opacity_target(ps, w);
|
||||
}
|
||||
|
||||
*animation_running = true;
|
||||
}
|
||||
|
||||
@@ -2352,7 +2352,6 @@ static session_t *session_init(int argc, char **argv, Display *dpy,
|
||||
ev_idle_init(&ps->draw_idle, draw_callback);
|
||||
|
||||
ev_init(&ps->fade_timer, fade_timer_callback);
|
||||
ev_init(&ps->animation_timer, animation_timer_callback);
|
||||
|
||||
// Set up SIGUSR1 signal handler to reset program
|
||||
ev_signal_init(&ps->usr1_signal, reset_enable, SIGUSR1);
|
||||
@@ -2452,6 +2451,7 @@ static session_t *session_init(int argc, char **argv, Display *dpy,
|
||||
}
|
||||
free_winprop(&prop);
|
||||
}
|
||||
ev_init(&ps->animation_timer, animation_timer_callback);
|
||||
|
||||
if (fork && stderr_logger) {
|
||||
// Remove the stderr logger if we will fork
|
||||
|
||||
14
src/win.c
14
src/win.c
@@ -667,13 +667,15 @@ void win_process_update_flags(session_t *ps, struct managed_win *w) {
|
||||
add_damage_from_win(ps, w);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Determine if a window should animate
|
||||
if (win_should_animate(ps, w)) {
|
||||
win_update_bounding_shape(ps, w);
|
||||
if (w->pending_g.y < 0 && w->g.y > 0 && abs(w->pending_g.y - w->g.y) >= w->pending_g.height)
|
||||
w->dwm_mask = ANIM_PREV_TAG;
|
||||
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)
|
||||
w->dwm_mask = ANIM_NEXT_TAG;
|
||||
w->dwm_mask = ANIM_NEXT_TAG;
|
||||
|
||||
if (!was_visible || w->dwm_mask) {
|
||||
|
||||
@@ -1464,8 +1466,10 @@ void win_on_factor_change(session_t *ps, struct managed_win *w) {
|
||||
// focused state of the window
|
||||
win_update_focused(ps, w);
|
||||
|
||||
win_determine_shadow(ps, w);
|
||||
win_determine_clip_shadow_above(ps, w);
|
||||
if (w->animation_progress > 0.9999 || w->animation_progress < 0.0001) {
|
||||
win_determine_shadow(ps, w);
|
||||
win_determine_clip_shadow_above(ps, w);
|
||||
}
|
||||
win_determine_invert_color(ps, w);
|
||||
win_determine_blur_background(ps, w);
|
||||
win_determine_rounded_corners(ps, w);
|
||||
@@ -1776,7 +1780,7 @@ struct win *fill_win(session_t *ps, struct win *w) {
|
||||
.animation_velocity_y = 0.0, // updated by window geometry changes
|
||||
.animation_velocity_w = 0.0, // updated by window geometry changes
|
||||
.animation_velocity_h = 0.0, // updated by window geometry changes
|
||||
.animation_progress = 1.0, // updated by window geometry changes
|
||||
.animation_progress = 0.0, // updated by window geometry changes
|
||||
.animation_inv_og_distance = NAN, // updated by window geometry changes
|
||||
.reg_ignore_valid = false, // set to true when damaged
|
||||
.flags = WIN_FLAGS_IMAGES_NONE, // updated by property/attributes/etc
|
||||
|
||||
Reference in New Issue
Block a user