diff options
author | Richard Grenville <[email protected]> | 2012-09-11 21:33:03 +0800 |
---|---|---|
committer | Richard Grenville <[email protected]> | 2012-09-11 21:33:03 +0800 |
commit | f7bf27f8380cda8c8c27cbfa19c9a656d638b39a (patch) | |
tree | 7fba94cc62ce1c52cde9c9625a07c049823b2c94 /compton.h | |
parent | fe811d6451944e6643a8bfae13050b23bf7254c9 (diff) | |
download | tdebase-f7bf27f8380cda8c8c27cbfa19c9a656d638b39a.tar.gz tdebase-f7bf27f8380cda8c8c27cbfa19c9a656d638b39a.zip |
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.
Diffstat (limited to 'compton.h')
-rw-r--r-- | compton.h | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -20,6 +20,7 @@ #include <X11/extensions/Xcomposite.h> #include <X11/extensions/Xdamage.h> #include <X11/extensions/Xrender.h> +#include <X11/extensions/shape.h> #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); |