From f7bf27f8380cda8c8c27cbfa19c9a656d638b39a Mon Sep 17 00:00:00 2001 From: Richard Grenville Date: Tue, 11 Sep 2012 21:33:03 +0800 Subject: Bug fix: Issue #36: Chromium window painting problems More descriptions on issue #36. - Listens ShapeNotify event to get around the Chromium window painting issues. - Adds dependency on X Shape extension. - Adds a few functions for convenience, so a bit code clean up. - Better event debug support, adds restack_win() debug. --- compton.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'compton.h') diff --git a/compton.h b/compton.h index 18e385989..6f30391d0 100644 --- a/compton.h +++ b/compton.h @@ -20,6 +20,7 @@ #include #include #include +#include #if COMPOSITE_MAJOR > 0 || COMPOSITE_MINOR >= 2 #define HAS_NAME_WINDOW_PIXMAP 1 @@ -28,6 +29,7 @@ #define CAN_DO_USABLE 0 #define DEBUG_REPAINT 0 #define DEBUG_EVENTS 0 +#define DEBUG_RESTACK 0 #define DEBUG_WINTYPE 0 #define MONITOR_REPAINT 0 @@ -124,6 +126,7 @@ typedef struct _fade { Display *dpy; } fade; +extern int root_height, root_width; /** * Functions */ @@ -345,6 +348,42 @@ ev_property_notify(XPropertyEvent *ev); inline static void ev_damage_notify(XDamageNotifyEvent *ev); +/** + * Destory the cached border_size of a window. + */ +inline static void win_free_border_size(Display *dpy, win *w) { + if (w->border_size) { + set_ignore(dpy, NextRequest(dpy)); + XFixesDestroyRegion(dpy, w->border_size); + w->border_size = None; + } +} + +/** + * Get a region of the screen size. + */ +inline static XserverRegion get_screen_region(Display *dpy) { + XRectangle r; + + r.x = 0; + r.y = 0; + r.width = root_width; + r.height = root_height; + return XFixesCreateRegion(dpy, &r, 1); +} + +/** + * Copies a region + */ +inline static XserverRegion copy_region(Display *dpy, + XserverRegion oldregion) { + XserverRegion region = XFixesCreateRegion(dpy, NULL, 0); + + XFixesCopyRegion(dpy, region, oldregion); + + return region; +} + inline static void ev_handle(XEvent *ev); -- cgit v1.2.1