X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=driver%2Fxscreensaver.c;h=dda587a12f81c2da057bdff4c884b2760224a66e;hp=7b16c898aaab4d95f22aa643084ed3842b2cd772;hb=a719ec12b8b2563112366a8ac3196816fd64d2c7;hpb=59ac4e9a0de290e4275a7bbb890ad16abd09d68f diff --git a/driver/xscreensaver.c b/driver/xscreensaver.c index 7b16c898..dda587a1 100644 --- a/driver/xscreensaver.c +++ b/driver/xscreensaver.c @@ -879,7 +879,25 @@ main_loop (saver_info *si) maybe_reload_init_file (si); - blank_screen (si); + if (! blank_screen (si)) + { + /* We were unable to grab either the keyboard or mouse. + This means we did not (and must not) blank the screen. + If we were to blank the screen while some other program + is holding both the mouse and keyboard grabbed, then + we would never be able to un-blank it! We would never + see any events, and the display would be wedged. + + So, just go around the loop again and wait for the + next bout of idleness. + */ + + fprintf (stderr, + "%s: unable to grab keyboard or mouse! Blanking aborted.\n", + blurb(), timestring ()); + continue; + } + kill_screenhack (si); spawn_screenhack (si, True);