Track changes to _XROOTPMAP_ID property
This commit is contained in:
parent
9e767b89cf
commit
41293ef755
|
@ -1,3 +1,9 @@
|
||||||
|
2003-11-10 Keith Packard <keithp@keithp.com>
|
||||||
|
|
||||||
|
* Makefile:
|
||||||
|
* xcompmgr.c: (root_tile), (main):
|
||||||
|
Track changes to _XROOTPMAP_ID property
|
||||||
|
|
||||||
2003-11-09 Keith Packard <keithp@keithp.com>
|
2003-11-09 Keith Packard <keithp@keithp.com>
|
||||||
|
|
||||||
* xcompmgr.c: (time_in_millis), (main):
|
* xcompmgr.c: (time_in_millis), (main):
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -1,5 +1,7 @@
|
||||||
LIBS=`pkg-config --cflags --libs xcomposite xfixes xdamage xrender` -lm
|
LIBS=`pkg-config --cflags --libs xcomposite xfixes xdamage xrender` -lm
|
||||||
|
|
||||||
|
CFLAGS=-O -g
|
||||||
|
|
||||||
xcompmgr: xcompmgr.c
|
xcompmgr: xcompmgr.c
|
||||||
$(CC) -o $@ $(CFLAGS) xcompmgr.c $(LIBS)
|
$(CC) -o $@ $(CFLAGS) xcompmgr.c $(LIBS)
|
||||||
|
|
||||||
|
|
20
xcompmgr.c
20
xcompmgr.c
|
@ -65,6 +65,7 @@ Picture rootTile;
|
||||||
XserverRegion allDamage;
|
XserverRegion allDamage;
|
||||||
int root_height, root_width;
|
int root_height, root_width;
|
||||||
|
|
||||||
|
#define BACKGROUND_PROP "_XROOTPMAP_ID"
|
||||||
#define WINDOW_PLAIN 0
|
#define WINDOW_PLAIN 0
|
||||||
#define WINDOW_DROP 1
|
#define WINDOW_DROP 1
|
||||||
#define WINDOW_TRANS 2
|
#define WINDOW_TRANS 2
|
||||||
|
@ -326,7 +327,7 @@ root_tile (Display *dpy)
|
||||||
Bool fill;
|
Bool fill;
|
||||||
XRenderPictureAttributes pa;
|
XRenderPictureAttributes pa;
|
||||||
|
|
||||||
if (XGetWindowProperty (dpy, root, XInternAtom (dpy, "_XROOTPMAP_ID", False),
|
if (XGetWindowProperty (dpy, root, XInternAtom (dpy, BACKGROUND_PROP, False),
|
||||||
0, 4, False, AnyPropertyType,
|
0, 4, False, AnyPropertyType,
|
||||||
&actual_type, &actual_format, &nitems, &bytes_after, &prop) == Success &&
|
&actual_type, &actual_format, &nitems, &bytes_after, &prop) == Success &&
|
||||||
actual_type == XInternAtom (dpy, "PIXMAP", False) && actual_format == 32 && nitems == 1)
|
actual_type == XInternAtom (dpy, "PIXMAP", False) && actual_format == 32 && nitems == 1)
|
||||||
|
@ -816,7 +817,11 @@ main ()
|
||||||
XGrabServer (dpy);
|
XGrabServer (dpy);
|
||||||
XCompositeRedirectSubwindows (dpy, root, CompositeRedirectManual);
|
XCompositeRedirectSubwindows (dpy, root, CompositeRedirectManual);
|
||||||
paint_all (dpy, None);
|
paint_all (dpy, None);
|
||||||
XSelectInput (dpy, root, SubstructureNotifyMask|ExposureMask|StructureNotifyMask);
|
XSelectInput (dpy, root,
|
||||||
|
SubstructureNotifyMask|
|
||||||
|
ExposureMask|
|
||||||
|
StructureNotifyMask|
|
||||||
|
PropertyChangeMask);
|
||||||
XQueryTree (dpy, root, &root_return, &parent_return, &children, &nchildren);
|
XQueryTree (dpy, root, &root_return, &parent_return, &children, &nchildren);
|
||||||
for (i = 0; i < nchildren; i++)
|
for (i = 0; i < nchildren; i++)
|
||||||
add_win (dpy, children[i], i ? children[i-1] : None);
|
add_win (dpy, children[i], i ? children[i-1] : None);
|
||||||
|
@ -882,6 +887,17 @@ main ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case PropertyNotify:
|
||||||
|
if (ev.xproperty.atom == XInternAtom (dpy, BACKGROUND_PROP, False))
|
||||||
|
{
|
||||||
|
if (rootTile)
|
||||||
|
{
|
||||||
|
XClearArea (dpy, root, 0, 0, 0, 0, True);
|
||||||
|
XRenderFreePicture (dpy, rootTile);
|
||||||
|
rootTile = None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if (ev.type == damage_event + XDamageNotify)
|
if (ev.type == damage_event + XDamageNotify)
|
||||||
damage_win (dpy, (XDamageNotifyEvent *) &ev);
|
damage_win (dpy, (XDamageNotifyEvent *) &ev);
|
||||||
|
|
Loading…
Reference in New Issue