Detect root pattern with undocumented _XROOTPMAP_ID property
This commit is contained in:
parent
d98b963d75
commit
e142128dde
|
@ -1,3 +1,8 @@
|
||||||
|
2003-11-09 Keith Packard <keithp@keithp.com>
|
||||||
|
|
||||||
|
* xcompmgr.c: (root_tile), (paint_root):
|
||||||
|
Detect root pattern with undocumented _XROOTPMAP_ID property
|
||||||
|
|
||||||
2003-11-09 Keith Packard <keithp@keithp.com>
|
2003-11-09 Keith Packard <keithp@keithp.com>
|
||||||
|
|
||||||
* Makefile:
|
* Makefile:
|
||||||
|
|
54
xcompmgr.c
54
xcompmgr.c
|
@ -35,6 +35,7 @@ int scr;
|
||||||
Window root;
|
Window root;
|
||||||
Picture rootPicture;
|
Picture rootPicture;
|
||||||
Picture transPicture;
|
Picture transPicture;
|
||||||
|
Picture rootTile;
|
||||||
XserverRegion allDamage;
|
XserverRegion allDamage;
|
||||||
|
|
||||||
#define WINDOW_PLAIN 0
|
#define WINDOW_PLAIN 0
|
||||||
|
@ -285,15 +286,58 @@ find_win (Display *dpy, Window id)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Picture
|
||||||
|
root_tile (Display *dpy)
|
||||||
|
{
|
||||||
|
Picture picture;
|
||||||
|
Atom actual_type;
|
||||||
|
Pixmap pixmap;
|
||||||
|
int actual_format;
|
||||||
|
unsigned long nitems;
|
||||||
|
unsigned long bytes_after;
|
||||||
|
unsigned char *prop;
|
||||||
|
Bool fill;
|
||||||
|
XRenderPictureAttributes pa;
|
||||||
|
|
||||||
|
if (XGetWindowProperty (dpy, root, XInternAtom (dpy, "_XROOTPMAP_ID", False),
|
||||||
|
0, 4, False, AnyPropertyType,
|
||||||
|
&actual_type, &actual_format, &nitems, &bytes_after, &prop) == Success)
|
||||||
|
{
|
||||||
|
memcpy (&pixmap, prop, 4);
|
||||||
|
XFree (prop);
|
||||||
|
fill = False;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pixmap = XCreatePixmap (dpy, root, 1, 1, DefaultDepth (dpy, scr));
|
||||||
|
fill = True;
|
||||||
|
}
|
||||||
|
pa.repeat = True;
|
||||||
|
picture = XRenderCreatePicture (dpy, pixmap,
|
||||||
|
XRenderFindVisualFormat (dpy,
|
||||||
|
DefaultVisual (dpy, scr)),
|
||||||
|
CPRepeat, &pa);
|
||||||
|
if (fill)
|
||||||
|
{
|
||||||
|
XRenderColor c;
|
||||||
|
|
||||||
|
c.red = c.green = c.blue = 0x8080;
|
||||||
|
c.alpha = 0xffff;
|
||||||
|
XRenderFillRectangle (dpy, PictOpSrc, picture, &c,
|
||||||
|
0, 0, 1, 1);
|
||||||
|
}
|
||||||
|
return picture;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
paint_root (Display *dpy)
|
paint_root (Display *dpy)
|
||||||
{
|
{
|
||||||
XRenderColor c;
|
if (!rootTile)
|
||||||
|
rootTile = root_tile (dpy);
|
||||||
|
|
||||||
c.red = c.green = c.blue = 0x8080;
|
XRenderComposite (dpy, PictOpSrc,
|
||||||
c.alpha = 0xffff;
|
rootTile, None, rootPicture,
|
||||||
XRenderFillRectangle (dpy, PictOpSrc, rootPicture, &c,
|
0, 0, 0, 0, 0, 0, 32767, 32767);
|
||||||
0, 0, 32767, 32767);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
XserverRegion
|
XserverRegion
|
||||||
|
|
Loading…
Reference in New Issue