From 635351c8204e683cc47ba239bea684f04f0e52b5 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sun, 17 Feb 2019 18:09:22 +0000 Subject: [PATCH] Remove win::*_last A side effect of this is that some window properties are allowed to change during fade-in/out. (e.g. window background can become blurred during window fade out if window properties changed so blur is requirired). But it is unclear what is the expected behaviour in this case anyway, so we choose the one that is simpler to implement. Signed-off-by: Yuxuan Shui --- src/compton.c | 15 --------------- src/win.c | 3 +-- src/win.h | 6 ------ 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/compton.c b/src/compton.c index c6f169c..979ad2f 100644 --- a/src/compton.c +++ b/src/compton.c @@ -498,14 +498,6 @@ paint_preprocess(session_t *ps, win *list, bool *fade_running) { const winmode_t mode_old = w->mode; const bool was_painted = w->to_paint; const opacity_t opacity_old = w->opacity; - // Restore flags from last paint if the window is being faded out - // TODO probably should just stop updating window flags when window - // is fading out - if (w->state == WSTATE_UNMAPPING || w->state == WSTATE_DESTROYING) { - win_set_shadow(ps, w, w->shadow_last); - win_set_invert_color(ps, w, w->invert_color_last); - win_set_blur_background(ps, w, w->blur_background_last); - } if (win_should_dim(ps, w) != w->dim) { w->dim = win_should_dim(ps, w); @@ -648,13 +640,6 @@ paint_preprocess(session_t *ps, win *list, bool *fade_running) { // Avoid setting w->to_paint if w is freed if (w) { w->to_paint = to_paint; - - if (w->to_paint) { - // Save flags - w->shadow_last = w->shadow; - w->invert_color_last = w->invert_color; - w->blur_background_last = w->blur_background; - } } } diff --git a/src/win.c b/src/win.c index f0a9691..95a7860 100644 --- a/src/win.c +++ b/src/win.c @@ -387,7 +387,6 @@ bool win_should_dim(session_t *ps, const win *w) { */ bool win_should_fade(session_t *ps, const win *w) { // To prevent it from being overwritten by last-paint value if the window is - // unmapped on next frame, write w->fade_last as well if (w->fade_force != UNSET) { return w->fade_force; } @@ -1405,7 +1404,7 @@ unmap_win(session_t *ps, win **_w, bool destroy) { if (unlikely(w->state == WSTATE_UNMAPPED)) { if (unlikely(!destroy)) { - log_warn("Unmapping an already unmapped window twice"); + log_warn("Unmapping an already unmapped window %#010x %s twice", w->id, w->name); return; } // Window is already unmapped, just destroy it diff --git a/src/win.h b/src/win.h index 70c5de5..391f384 100644 --- a/src/win.h +++ b/src/win.h @@ -247,8 +247,6 @@ struct win { // Shadow-related members /// Whether a window has shadow. Calculated. bool shadow; - /// Shadow state on last paint. - bool shadow_last; /// Override value of window shadow state. Set by D-Bus method calls. switch_t shadow_force; /// Opacity of the shadow. Affected by window opacity and frame opacity. @@ -273,16 +271,12 @@ struct win { /// Whether to invert window color. bool invert_color; - /// Color inversion state on last paint. - bool invert_color_last; /// Override value of window color inversion state. Set by D-Bus method /// calls. switch_t invert_color_force; /// Whether to blur window background. bool blur_background; - /// Background state on last paint. - bool blur_background_last; #ifdef CONFIG_OPENGL /// Textures and FBO background blur use.