Add DEBUG_FADE

This adds printf_dbgf statements to debug issues with fading.
pull/2/head
Daniel Hahler 10 years ago committed by Timothy Pearson
parent ce4f259946
commit a2ee4721b6

@ -36,6 +36,7 @@
// #define DEBUG_GLX_MARK 1 // #define DEBUG_GLX_MARK 1
// #define DEBUG_GLX_PAINTREG 1 // #define DEBUG_GLX_PAINTREG 1
// #define MONITOR_REPAINT 1 // #define MONITOR_REPAINT 1
// #define DEBUG_FADE 1
// Whether to enable PCRE regular expression support in blacklists, enabled // Whether to enable PCRE regular expression support in blacklists, enabled
// by default // by default

@ -291,6 +291,9 @@ set_fade_callback(session_t *ps, win *w,
w->fade_callback = callback; w->fade_callback = callback;
// Must be the last line as the callback could destroy w! // Must be the last line as the callback could destroy w!
if (exec_callback && old_callback) { if (exec_callback && old_callback) {
#ifdef DEBUG_FADE
printf_dbgf("(%#010lx): exec callback\n", w->id);
#endif
old_callback(ps, w); old_callback(ps, w);
// Although currently no callback function affects window state on // Although currently no callback function affects window state on
// next paint, it could, in the future // next paint, it could, in the future
@ -2426,9 +2429,15 @@ 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) {
w->in_openclose = false; w->in_openclose = false;
#ifdef DEBUG_FADE
printf_dbgf("(%#010lx)\n", w->id);
#endif
if (ps->o.no_fading_openclose) { if (ps->o.no_fading_openclose) {
win_determine_fade(ps, w); win_determine_fade(ps, w);
} }
#ifdef DEBUG_FADE
printf_dbgf("(%#010lx): end\n", w->id);
#endif
} }
static void static void
@ -2718,14 +2727,25 @@ 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) {
if (UNSET != w->fade_force) if (UNSET != w->fade_force) {
#ifdef DEBUG_FADE
printf_dbgf("(%#010lx): fade forced\n", w->id);
#endif
w->fade = w->fade_force; w->fade = w->fade_force;
else if (ps->o.no_fading_opacitychange && (!w->in_openclose)) }
else if (ps->o.no_fading_openclose && (w->in_openclose || w->destroyed)) {
#ifdef DEBUG_FADE
printf_dbgf("(): no_fading_openclose and in_openclose\n");
#endif
w->fade = false; w->fade = false;
else if (ps->o.no_fading_openclose && w->in_openclose) }
else if (ps->o.no_fading_opacitychange && (!w->in_openclose))
w->fade = false; w->fade = false;
else if (ps->o.no_fading_destroyed_argb && w->destroyed else if (ps->o.no_fading_destroyed_argb && w->destroyed
&& WMODE_ARGB == w->mode && w->client_win && w->client_win != w->id) { && WMODE_ARGB == w->mode && w->client_win && w->client_win != w->id) {
#ifdef DEBUG_FADE
printf_dbgf("(): no_fading_destroyed_argb\n");
#endif
w->fade = false; w->fade = false;
// Prevent it from being overwritten by last-paint value // Prevent it from being overwritten by last-paint value
w->fade_last = false; w->fade_last = false;
@ -2733,11 +2753,29 @@ win_determine_fade(session_t *ps, win *w) {
// Ignore other possible causes of fading state changes after window // Ignore other possible causes of fading state changes after window
// gets unmapped // gets unmapped
else if (IsViewable != w->a.map_state) { else if (IsViewable != w->a.map_state) {
#ifdef DEBUG_FADE
printf_dbgf("(): ignored: !IsViewable\n");
#endif
} }
else if (win_match(ps, w, ps->o.fade_blacklist, &w->cache_fblst)) else if (win_match(ps, w, ps->o.fade_blacklist, &w->cache_fblst)) {
w->fade = false; w->fade = false;
else }
else if (ps->o.wintype_fade[w->window_type] != NULL) {
w->fade = ps->o.wintype_fade[w->window_type]; w->fade = ps->o.wintype_fade[w->window_type];
#ifdef DEBUG_FADE
printf_dbgf("(%#010lx): via wintype_fade[%s]\n",
w->id, WINTYPES[w->window_type]);
#endif
} else {
#ifdef DEBUG_FADE
printf_dbgf("(): fallthrough\n");
#endif
}
#ifdef DEBUG_FADE
printf_dbgf("(%#010lx): fade = %d\n", w->id, w->fade ? w->fade : NULL);
#endif
} }
/** /**

Loading…
Cancel
Save