X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Fwindows.c;h=7a938c5a53a7f394bc4c605c0aed99c0238041c6;hb=6bb727f03bff0389fbb1349d7df4c9d8d7532959;hp=06c0bb4ecb865413585fbb1de208c719ac969927;hpb=5b7bc6e70fb439cf4c4bf771ae9f94077fe4fe08;p=xscreensaver diff --git a/driver/windows.c b/driver/windows.c index 06c0bb4e..7a938c5a 100644 --- a/driver/windows.c +++ b/driver/windows.c @@ -1,5 +1,5 @@ /* windows.c --- turning the screen black; dealing with visuals, virtual roots. - * xscreensaver, Copyright (c) 1991-1997 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-1998 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -822,6 +822,10 @@ raise_window (saver_info *si, current_maps[i] = (between_hacks_p ? ssi->cmap : DefaultColormapOfScreen (ssi->screen)); + /* Ensure that the default background of the window is really black, + not a pixmap or something. (This does not clear the window.) */ + XSetWindowBackground (si->dpy, ssi->screensaver_window, + ssi->black_pixel); } if (p->verbose_p) fprintf (stderr, "%s: fading... ", progname); @@ -941,11 +945,17 @@ unblank_screen (saver_info *si) { saver_screen_info *ssi = &si->screens[i]; current_windows[i] = ssi->screensaver_window; + /* Ensure that the default background of the window is really black, + not a pixmap or something. (This does not clear the window.) */ + XSetWindowBackground (si->dpy, ssi->screensaver_window, + ssi->black_pixel); } if (p->verbose_p) fprintf (stderr, "%s: unfading... ", progname); + XSync (si->dpy, False); XGrabServer (si->dpy); + XSync (si->dpy, False); for (i = 0; i < si->nscreens; i++) { saver_screen_info *ssi = &si->screens[i]; @@ -955,6 +965,7 @@ unblank_screen (saver_info *si) clear_stderr (ssi); } XUngrabServer (si->dpy); + XSync (si->dpy, False); fade_screens (si->dpy, 0, current_windows, p->fade_seconds, p->fade_ticks, @@ -1025,6 +1036,13 @@ unblank_screen (saver_info *si) } #endif + /* Unmap the windows a second time, dammit -- just to avoid a race + with the screen-grabbing hacks. (I'm not sure if this is really + necessary; I'm stabbing in the dark now.) + */ + for (i = 0; i < si->nscreens; i++) + XUnmapWindow (si->dpy, si->screens[i].screensaver_window); + si->screen_blanked_p = False; }