From f83ed19e14b973bd7f580da5b5de757e9f11e521 Mon Sep 17 00:00:00 2001 From: Richard Grenville Date: Sat, 27 Oct 2012 21:46:01 +0800 Subject: [PATCH] Bug fix #57: Fix incorrect handling of InputOnly windows - Stop rendering InputOnly windows. In the past I've misunderstood the whole thing, I guess, sorry. Thanks to garfilth and funeral1988 for reporting and providing valuable information. - Fix a possible segfault in DDEBUG_EVENTS. - Add "dbe" as a configuration file option. - Attempt to slightly reduce the rendering delay after VSync in non-DBE mode. I don't think, however, that this would be greatly helpful for the tearing issue. --- compton.sample.conf | 3 ++- src/compton.c | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/compton.sample.conf b/compton.sample.conf index 3e36d3d..c8d6304 100644 --- a/compton.sample.conf +++ b/compton.sample.conf @@ -32,9 +32,10 @@ fade-out-step = 0.03; mark-wmwin-focused = true; mark-ovredir-focused = true; detect-rounded-corners = true; -detect-client-opacity = false; +detect-client-opacity = true; refresh-rate = 0; vsync = "none"; +dbe = false; paint-on-overlay = true; sw-opti = false; diff --git a/src/compton.c b/src/compton.c index 4394e80..090bae8 100755 --- a/src/compton.c +++ b/src/compton.c @@ -784,6 +784,13 @@ win_match_once(win *w, const wincond *cond) { cond); #endif + if (InputOnly == w->a.class) { +#ifdef DEBUG_WINMATCH + printf(": InputOnly\n"); +#endif + return false; + } + // Determine the target target = NULL; switch (cond->target) { @@ -1710,6 +1717,10 @@ paint_all(Display *dpy, XserverRegion region, win *t) { XFixesDestroyRegion(dpy, reg_tmp); XFixesDestroyRegion(dpy, reg_tmp2); + // Do this as early as possible + if (!opts.dbe) + XFixesSetPictureClipRegion(dpy, tgt_buffer, 0, 0, None); + // Wait for VBlank vsync_wait(); @@ -1724,7 +1735,6 @@ paint_all(Display *dpy, XserverRegion region, win *t) { } // No-DBE painting mode else if (tgt_buffer != tgt_picture) { - XFixesSetPictureClipRegion(dpy, tgt_buffer, 0, 0, None); XRenderComposite( dpy, PictOpSrc, tgt_buffer, None, tgt_picture, 0, 0, 0, 0, @@ -1819,7 +1829,8 @@ map_win(Display *dpy, Window id, Bool override_redirect) { win *w = find_win(dpy, id); - if (!w) return; + // Don't care about window mapping if it's an InputOnly window + if (!w || InputOnly == w->a.class) return; reg_ignore_expire = True; @@ -3167,7 +3178,7 @@ ev_handle(XEvent *ev) { if (!w) w = find_toplevel(dpy, wid); - if (w->name) + if (w && w->name) window_name = w->name; else to_free = (Bool) wid_get_name(dpy, wid, &window_name); @@ -3686,6 +3697,8 @@ parse_config(char *cpath, struct options_tmp *pcfgtmp) { parse_vsync(sval); // --alpha-step config_lookup_float(&cfg, "alpha-step", &opts.alpha_step); + // --dbe + lcfg_lookup_bool(&cfg, "dbe", &opts.dbe); // --paint-on-overlay lcfg_lookup_bool(&cfg, "paint-on-overlay", &opts.paint_on_overlay); // --sw-opti