X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=utils%2Fgrabscreen.c;h=6f88e5a10dc4ad9772c8a9874cf44d41a5968a65;hb=c596d1306f5f92f7eab76224d3b049980a14adcb;hp=7e4a37a3dc46b4a7018dc1f8965aa1ef2711d6f6;hpb=ce3185de9d9705e259f2b60dd4b5509007fa17d4;p=xscreensaver diff --git a/utils/grabscreen.c b/utils/grabscreen.c index 7e4a37a3..6f88e5a1 100644 --- a/utils/grabscreen.c +++ b/utils/grabscreen.c @@ -132,7 +132,10 @@ BadWindow_ehandler (Display *dpy, XErrorEvent *error) if (error->error_code == BadWindow || error->error_code == BadDrawable) return 0; else if (!old_ehandler) - abort(); + { + abort(); + return 0; + } else return (*old_ehandler) (dpy, error); } @@ -285,6 +288,13 @@ grab_screen_image_1 (Screen *screen, Window window) #endif /* DEBUG */ copy_default_colormap_contents (screen, xgwa.colormap, xgwa.visual); raise_window(dpy, window, saver_p); + + /* Generally it's bad news to call XInstallColormap() explicitly, + but this file does a lot of sleazy stuff already... This is to + make sure that the window's colormap is installed, even in the + case where the window is OverrideRedirect. */ + if (xgwa.colormap) XInstallColormap (dpy, xgwa.colormap); + XSync (dpy, False); } } else /* root_p */