summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Hahler <github@thequod.de>2014-11-17 22:59:39 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-11-17 22:59:39 -0600
commita2ee4721b6eeecc047f764b88b0c2e0ee96a3dc9 (patch)
tree53eb736220898ab9e6cc0ee62ffd255b58163587
parentce4f259946672ba5243c195b479ca3b3f1421a83 (diff)
downloadtdebase-a2ee4721b6eeecc047f764b88b0c2e0ee96a3dc9.tar.gz
tdebase-a2ee4721b6eeecc047f764b88b0c2e0ee96a3dc9.zip
Add DEBUG_FADE
This adds printf_dbgf statements to debug issues with fading.
-rw-r--r--twin/compton-tde/common.h1
-rw-r--r--twin/compton-tde/compton.c52
2 files changed, 46 insertions, 7 deletions
diff --git a/twin/compton-tde/common.h b/twin/compton-tde/common.h
index 4d9f41090..acaf68651 100644
--- a/twin/compton-tde/common.h
+++ b/twin/compton-tde/common.h
@@ -36,6 +36,7 @@
// #define DEBUG_GLX_MARK 1
// #define DEBUG_GLX_PAINTREG 1
// #define MONITOR_REPAINT 1
+// #define DEBUG_FADE 1
// Whether to enable PCRE regular expression support in blacklists, enabled
// by default
diff --git a/twin/compton-tde/compton.c b/twin/compton-tde/compton.c
index 76cbb1838..74302da22 100644
--- a/twin/compton-tde/compton.c
+++ b/twin/compton-tde/compton.c
@@ -291,6 +291,9 @@ set_fade_callback(session_t *ps, win *w,
w->fade_callback = callback;
// Must be the last line as the callback could destroy w!
if (exec_callback && old_callback) {
+#ifdef DEBUG_FADE
+ printf_dbgf("(%#010lx): exec callback\n", w->id);
+#endif
old_callback(ps, w);
// Although currently no callback function affects window state on
// next paint, it could, in the future
@@ -2426,9 +2429,15 @@ map_win(session_t *ps, Window id) {
static void
finish_map_win(session_t *ps, win *w) {
w->in_openclose = false;
+#ifdef DEBUG_FADE
+ printf_dbgf("(%#010lx)\n", w->id);
+#endif
if (ps->o.no_fading_openclose) {
win_determine_fade(ps, w);
}
+#ifdef DEBUG_FADE
+ printf_dbgf("(%#010lx): end\n", w->id);
+#endif
}
static void
@@ -2718,14 +2727,25 @@ calc_dim(session_t *ps, win *w) {
*/
static void
win_determine_fade(session_t *ps, win *w) {
- if (UNSET != w->fade_force)
- w->fade = w->fade_force;
- else if (ps->o.no_fading_opacitychange && (!w->in_openclose))
+ if (UNSET != w->fade_force) {
+#ifdef DEBUG_FADE
+ printf_dbgf("(%#010lx): fade forced\n", w->id);
+#endif
+ w->fade = w->fade_force;
+ }
+ 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;
- else if (ps->o.no_fading_openclose && w->in_openclose)
+ }
+ else if (ps->o.no_fading_opacitychange && (!w->in_openclose))
w->fade = false;
else if (ps->o.no_fading_destroyed_argb && w->destroyed
&& 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;
// Prevent it from being overwritten by last-paint value
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
// gets unmapped
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;
- else
- w->fade = ps->o.wintype_fade[w->window_type];
+ }
+ else if (ps->o.wintype_fade[w->window_type] != NULL) {
+ 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
}
/**