diff options
author | Richard Grenville <[email protected]> | 2012-11-03 10:30:32 +0800 |
---|---|---|
committer | Richard Grenville <[email protected]> | 2012-11-03 10:38:29 +0800 |
commit | 1dd73826f941d2034d763e47280e527e5c731309 (patch) | |
tree | 416a975ce36dc9e99ae1c44eedc09cb681ad72c7 /compton.h | |
parent | b7aee48ccae37dfdf5bb7025fac6f394a9abb335 (diff) | |
download | tdebase-1dd73826f941d2034d763e47280e527e5c731309.tar.gz tdebase-1dd73826f941d2034d763e47280e527e5c731309.zip |
Bug fix: A XserverRegion leak
- Fix a XserverRegion leak introduced in b78ab316fd. I hope this is the
reason of the slowdowns many users reported. Thanks to xrestop!
- Cache the screen region as a variable.
- Add debugging code for region allocation.
Diffstat (limited to 'compton.h')
-rw-r--r-- | compton.h | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -89,6 +89,26 @@ #include <GL/glx.h> #endif +#ifdef DEBUG_ALLOC_REG +static inline XserverRegion +XFixesCreateRegion_(Display *dpy, XRectangle *p, int n, + const char *func, int line) { + XserverRegion reg = XFixesCreateRegion(dpy, p, n); + printf("%#010lx: XFixesCreateRegion() in %s():%d\n", reg, func, line); + return reg; +} + +static inline void +XFixesDestroyRegion_(Display *dpy, XserverRegion reg, + const char *func, int line) { + XFixesDestroyRegion(dpy, reg); + printf("%#010lx: XFixesDestroyRegion() in %s():%d\n", reg, func, line); +} + +#define XFixesCreateRegion(dpy, p, n) XFixesCreateRegion_(dpy, p, n, __func__, __LINE__) +#define XFixesDestroyRegion(dpy, reg) XFixesDestroyRegion_(dpy, reg, __func__, __LINE__) +#endif + // === Constants === #if !(COMPOSITE_MAJOR > 0 || COMPOSITE_MINOR >= 2) #error libXcomposite version unsupported |