Have xss request a 1x1 window at (-1, -1) for X's built-in screensaver window.

It was a good idea after all.  I just map a window outside the viewable area, problem
solved.  I'm starting to think jwz is blowing smoke.
This commit is contained in:
Neale Pickett 2008-04-18 11:56:30 -06:00
parent 9c41538e70
commit 6bcf36e9eb
1 changed files with 19 additions and 6 deletions

25
xss.c
View File

@ -62,17 +62,30 @@ main(int argc, char *argv[])
}
root = RootWindow(display, screen);
XScreenSaverSelectInput(display, root, ScreenSaverNotifyMask);
/* Tell X to make the screen saver window 1 pixel by 1 pixel and off
the visible area, since we'll be creating our own. I suspect jwz
is just blowing smoke. */
{
XSetWindowAttributes attr;
attr.background_pixel = BlackPixel(display, screen);
XScreenSaverSetAttributes(display, root,
-1, -1,
1, 1,
0,
CopyFromParent, CopyFromParent,
CopyFromParent,
CWBackPixel,
&attr);
}
while (! XNextEvent(display, &event)) {
if (ss_event == event.type) {
XScreenSaverNotifyEvent *sevent = (XScreenSaverNotifyEvent *)&event;
if (ScreenSaverOn == sevent->state) {
#if 0
XScreenSaverInfo info;
if (XScreenSaverQueryInfo(display, (Drawable)root, &info)) {
XLowerWindow(display, info.window);
}
#endif
if (! child) {
child = fork();
if (0 == child) {