/* windows.c --- turning the screen black; dealing with visuals, virtual roots.
- * xscreensaver, Copyright (c) 1991-2008 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1991-2014 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
/* When should we allow blanking to proceed? The current theory
- is that a keyboard grab is manditory; a mouse grab is optional.
+ is that a keyboard grab is mandatory; a mouse grab is optional.
- If we don't have a keyboard grab, then we won't be able to
- read a password to unlock, so the kbd grab is manditory.
+ read a password to unlock, so the kbd grab is mandatory.
(We can't conditionalize this on locked_p, because someone
might run "xscreensaver-command -lock" at any time.)
- If we don't have a mouse grab, then we might not see mouse
clicks as a signal to unblank -- but we will still see kbd
activity, so that's not a disaster.
+
+ It has been suggested that we should allow blanking if locking
+ is disabled, and we have a mouse grab but no keyboard grab
+ (that is: kstatus != GrabSuccess &&
+ mstatus == GrabSuccess &&
+ si->locking_disabled_p)
+ That would allow screen blanking (but not locking) while the gdm
+ login screen had the keyboard grabbed, but one would have to use
+ the mouse to unblank. Keyboard characters would go to the gdm
+ login field without unblanking. I have not made this change
+ because I'm not completely convinced it is a safe thing to do.
*/
if (kstatus != GrabSuccess) /* Do not blank without a kbd grab. */
&& type != None)
{
unsigned char *id;
- if (!XGetWindowProperty (dpy, kids[i], XA_SCREENSAVER_ID, 0, 512,
+ if (XGetWindowProperty (dpy, kids[i], XA_SCREENSAVER_ID, 0, 512,
False, XA_STRING, &type, &format, &nitems,
&bytesafter, &id)
- == Success
+ != Success
|| type == None)
id = (unsigned char *) "???";
int x, y;
unsigned int mask;
XQueryPointer (si->dpy, ssi->screensaver_window, &root, &child,
- &ssi->poll_mouse_last_root_x,
- &ssi->poll_mouse_last_root_y,
+ &ssi->last_poll_mouse.root_x,
+ &ssi->last_poll_mouse.root_y,
&x, &y, &mask);
}
}
Bool unfade_p = (si->fading_possible_p && p->unfade_p);
int i;
- monitor_power_on (si);
+ monitor_power_on (si, True);
reset_watchdog_timer (si, False);
if (si->demoing_p)