Bug fix #75: --invert-color-include not working & others

- Fix a small bug that breaks --invert-color-include if no other
  blacklists are present. Thanks to MaskRay and xiaq for reporting.

- Disable --unredir-if-possible for multi-screen setups.

- Fix a bug that causes --no-fading-openclose to have no effect in some
  cases. Add w->in_openclose to keep track of window open/close state.
This commit is contained in:
Richard Grenville 2013-01-13 13:44:05 +08:00
parent 2165c42d27
commit e60fe72dcb
2 changed files with 26 additions and 14 deletions

View File

@ -1358,9 +1358,11 @@ paint_preprocess(session_t *ps, win *list) {
if (is_highest && to_paint) { if (is_highest && to_paint) {
is_highest = false; is_highest = false;
// Disable unredirection for multi-screen setups
if (WMODE_SOLID == w->mode if (WMODE_SOLID == w->mode
&& (!w->frame_opacity || !win_has_frame(w)) && (!w->frame_opacity || !win_has_frame(w))
&& win_is_fullscreen(ps, w)) && win_is_fullscreen(ps, w)
&& ScreenCount(ps->dpy) <= 1)
ps->unredir_possible = true; ps->unredir_possible = true;
} }
@ -1966,20 +1968,18 @@ map_win(session_t *ps, Window id) {
win_determine_shadow(ps, w); win_determine_shadow(ps, w);
// Set fading state // Set fading state
w->in_openclose = false;
if (ps->o.no_fading_openclose) { if (ps->o.no_fading_openclose) {
set_fade_callback(ps, w, finish_map_win, true); set_fade_callback(ps, w, finish_map_win, true);
// Must be set after we execute the old fade callback, in case we w->in_openclose = true;
// receive two continuous MapNotify for the same window
w->fade = false;
} }
else { else {
set_fade_callback(ps, w, NULL, true); set_fade_callback(ps, w, NULL, true);
win_determine_fade(ps, w);
} }
win_determine_fade(ps, w);
w->damaged = true; w->damaged = true;
/* if any configure events happened while /* if any configure events happened while
the window was unmapped, then configure the window was unmapped, then configure
the window to its correct place */ the window to its correct place */
@ -1990,14 +1990,18 @@ map_win(session_t *ps, Window id) {
static void static void
finish_map_win(session_t *ps, win *w) { finish_map_win(session_t *ps, win *w) {
if (ps->o.no_fading_openclose) w->in_openclose = false;
if (ps->o.no_fading_openclose) {
win_determine_fade(ps, w); win_determine_fade(ps, w);
}
} }
static void static void
finish_unmap_win(session_t *ps, win *w) { finish_unmap_win(session_t *ps, win *w) {
w->damaged = false; w->damaged = false;
w->in_openclose = false;
update_reg_ignore_expire(ps, w); update_reg_ignore_expire(ps, w);
if (w->extents != None) { if (w->extents != None) {
@ -2031,8 +2035,10 @@ unmap_win(session_t *ps, Window id) {
// Fading out // Fading out
w->flags |= WFLAG_OPCT_CHANGE; w->flags |= WFLAG_OPCT_CHANGE;
set_fade_callback(ps, w, unmap_callback, false); set_fade_callback(ps, w, unmap_callback, false);
if (ps->o.no_fading_openclose) if (ps->o.no_fading_openclose) {
w->fade = false; w->in_openclose = true;
win_determine_fade(ps, w);
}
// don't care about properties anymore // don't care about properties anymore
win_ev_stop(ps, w); win_ev_stop(ps, w);
@ -2154,7 +2160,10 @@ calc_dim(session_t *ps, win *w) {
*/ */
static void static void
win_determine_fade(session_t *ps, win *w) { win_determine_fade(session_t *ps, win *w) {
w->fade = ps->o.wintype_fade[w->window_type]; if (ps->o.no_fading_openclose && w->in_openclose)
w->fade = false;
else
w->fade = ps->o.wintype_fade[w->window_type];
} }
/** /**
@ -2485,12 +2494,13 @@ add_win(session_t *ps, Window id, Window prev) {
.need_configure = false, .need_configure = false,
.queue_configure = { }, .queue_configure = { },
.reg_ignore = None, .reg_ignore = None,
.destroyed = false,
.widthb = 0, .widthb = 0,
.heightb = 0, .heightb = 0,
.destroyed = false,
.bounding_shaped = false, .bounding_shaped = false,
.rounded_corners = false, .rounded_corners = false,
.to_paint = false, .to_paint = false,
.in_openclose = false,
.client_win = None, .client_win = None,
.window_type = WINTYPE_UNKNOWN, .window_type = WINTYPE_UNKNOWN,
@ -4733,7 +4743,7 @@ get_cfg(session_t *ps, int argc, char *const *argv) {
// Determine whether we need to track window name and class // Determine whether we need to track window name and class
if (ps->o.shadow_blacklist || ps->o.fade_blacklist if (ps->o.shadow_blacklist || ps->o.fade_blacklist
|| ps->o.focus_blacklist) || ps->o.focus_blacklist || ps->o.invert_color_list)
ps->o.track_wdata = true; ps->o.track_wdata = true;
// Determine whether we track window grouping // Determine whether we track window grouping

View File

@ -667,16 +667,18 @@ typedef struct _win {
/// opacity state, window geometry, window mapped/unmapped state, /// opacity state, window geometry, window mapped/unmapped state,
/// window mode, of this and all higher windows. /// window mode, of this and all higher windows.
XserverRegion reg_ignore; XserverRegion reg_ignore;
/// Whether the window has been destroyed.
bool destroyed;
/// Cached width/height of the window including border. /// Cached width/height of the window including border.
int widthb, heightb; int widthb, heightb;
/// Whether the window has been destroyed.
bool destroyed;
/// Whether the window is bounding-shaped. /// Whether the window is bounding-shaped.
bool bounding_shaped; bool bounding_shaped;
/// Whether the window just have rounded corners. /// Whether the window just have rounded corners.
bool rounded_corners; bool rounded_corners;
/// Whether this window is to be painted. /// Whether this window is to be painted.
bool to_paint; bool to_paint;
/// Whether this window is in open/close state.
bool in_openclose;
// Client window related members // Client window related members
/// ID of the top-level client window of the window. /// ID of the top-level client window of the window.