From 848103bc3447f814c51cb818836533e18e018bf5 Mon Sep 17 00:00:00 2001 From: Richard Grenville Date: Mon, 18 Mar 2013 11:48:28 +0800 Subject: Bug fix: GLX: ARGB texture too dark & Jitter when resize & others - GLX backend: Fix a bug that ARGB windows / shadows are rendered too dark. Thanks to derhass in FreeNode/##opengl for help. - GLX backend: Fix a problem that during window resize the content looks jittering, by letting compton fetch pixmap sizes with XGetGeometry() instead of relying on window width/height, which could be inaccurate during window resize. Negative effect on performance. Thanks to M4he for reporting. (#7) - Add .desktop file. Thanks to quequotion for providing it. (#97) - Avoid checking presence of window pixmap, because they may not exist with very old X Composite implementations. - Add workaround for a strange window restack issue when compton receieves a ConfigureNotify with non-existent new above window. - Add debugging function hexdump(). Extra sanity checks on various places. --- compton.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'compton.h') diff --git a/compton.h b/compton.h index 9c4bd0a9f..c16c59612 100644 --- a/compton.h +++ b/compton.h @@ -162,7 +162,9 @@ free_wincondlst(c2_lptr_t **pcondlst) { */ static inline bool paint_isvalid(session_t *ps, const paint_t *ppaint) { - if (!ppaint || !ppaint->pixmap) + // Don't check for presence of Pixmap here, because older X Composite doesn't + // provide it + if (!ppaint) return false; if (BKEND_XRENDER == ps->o.backend && !ppaint->pict) @@ -179,13 +181,15 @@ paint_isvalid(session_t *ps, const paint_t *ppaint) { * Bind texture in paint_t if we are using GLX backend. */ static inline bool -paint_bind_tex(session_t *ps, paint_t *ppaint, int wid, int hei, int depth, - bool force) { +paint_bind_tex(session_t *ps, paint_t *ppaint, + unsigned wid, unsigned hei, unsigned depth, bool force) { #ifdef CONFIG_VSYNC_OPENGL - // TODO: Make sure we have the same Pixmap binded? - if (BKEND_GLX == ps->o.backend - && (force || !glx_tex_binded(ppaint->ptex, ppaint->pixmap))) { - return glx_bind_pixmap(ps, &ppaint->ptex, ppaint->pixmap, wid, hei, depth); + if (BKEND_GLX == ps->o.backend) { + if (!ppaint->pixmap) + return false; + + if (force || !glx_tex_binded(ppaint->ptex, ppaint->pixmap)) + return glx_bind_pixmap(ps, &ppaint->ptex, ppaint->pixmap, wid, hei, depth); } #endif -- cgit v1.2.1