Only use XCompositeNameWindowPixmap when the library provides it

This commit is contained in:
Keith Packard 2004-06-27 21:29:23 +00:00
parent 9616aa5ba6
commit d140d97616
2 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2004-06-27 Keith Packard <keithp@keithp.com>
* xcompmgr.c: (map_win), (unmap_win), (main):
Only use XCompositeNameWindowPixmap when the library provides it
2004-06-26 Keith Packard <keithp@keithp.com> 2004-06-26 Keith Packard <keithp@keithp.com>
* xcompmgr.c: (win_extents), (paint_all), (repair_win), * xcompmgr.c: (win_extents), (paint_all), (repair_win),

View File

@ -43,6 +43,10 @@
#include <X11/extensions/Xdamage.h> #include <X11/extensions/Xdamage.h>
#include <X11/extensions/Xrender.h> #include <X11/extensions/Xrender.h>
#if COMPOSITE_MAJOR > 0 || COMPOSITE_MINOR >= 2
#define HAS_NAME_WINDOW_PIXMAP 1
#endif
typedef struct _ignore { typedef struct _ignore {
struct _ignore *next; struct _ignore *next;
unsigned long sequence; unsigned long sequence;
@ -91,7 +95,9 @@ Picture transBlackPicture;
Picture rootTile; Picture rootTile;
XserverRegion allDamage; XserverRegion allDamage;
Bool clipChanged; Bool clipChanged;
#if HAS_NAME_WINDOW_PIXMAP
Bool hasNamePixmap; Bool hasNamePixmap;
#endif
int root_height, root_width; int root_height, root_width;
ignore *ignore_head, **ignore_tail = &ignore_head; ignore *ignore_head, **ignore_tail = &ignore_head;
int xfixes_event, xfixes_error; int xfixes_event, xfixes_error;
@ -809,12 +815,14 @@ map_win (Display *dpy, Window id, unsigned long sequence)
return; return;
w->a.map_state = IsViewable; w->a.map_state = IsViewable;
#if HAS_NAME_WINDOW_PIXMAP
if (hasNamePixmap) if (hasNamePixmap)
{ {
w->pixmap = XCompositeNameWindowPixmap (dpy, id); w->pixmap = XCompositeNameWindowPixmap (dpy, id);
back = w->pixmap; back = w->pixmap;
} }
else else
#endif
{ {
w->pixmap = 0; w->pixmap = 0;
back = id; back = id;
@ -853,11 +861,13 @@ unmap_win (Display *dpy, Window id)
add_damage (dpy, w->extents); /* destroys region */ add_damage (dpy, w->extents); /* destroys region */
w->extents = None; w->extents = None;
} }
#if HAS_NAME_WINDOW_PIXMAP
if (hasNamePixmap) if (hasNamePixmap)
{ {
XFreePixmap (dpy, w->pixmap); XFreePixmap (dpy, w->pixmap);
w->pixmap = 0; w->pixmap = 0;
} }
#endif
if (w->picture) if (w->picture)
{ {
set_ignore (dpy, NextRequest (dpy)); set_ignore (dpy, NextRequest (dpy));
@ -1352,12 +1362,14 @@ main (int argc, char **argv)
exit (1); exit (1);
} }
XCompositeQueryVersion (dpy, &composite_major, &composite_minor); XCompositeQueryVersion (dpy, &composite_major, &composite_minor);
#if HAS_NAME_WINDOW_PIXMAP
#if 0 #if 0
/* /*
* Don't use this yet; we don't have set semantics for new pixmaps * Don't use this yet; we don't have set semantics for new pixmaps
*/ */
if (composite_major > 0 || composite_minor >= 2) if (composite_major > 0 || composite_minor >= 2)
hasNamePixmap = True; hasNamePixmap = True;
#endif
#endif #endif
if (!XDamageQueryExtension (dpy, &damage_event, &damage_error)) if (!XDamageQueryExtension (dpy, &damage_event, &damage_error))