ftp://ftp.swin.edu.au/slackware/slackware-9.1/source/xap/xscreensaver/xscreensaver...
[xscreensaver] / utils / grabscreen.c
index 9bcb4264ac90d86d283b0865347be6d1570cdec0..d9a520976c00b52234c01485427e77cab27bc5e1 100644 (file)
@@ -133,7 +133,6 @@ xscreensaver_window_p (Display *dpy, Window window)
 
 /* Whether the given window is:
    - the real root window;
-   - the virtual root window;
    - a direct child of the root window;
    - a direct child of the window manager's decorations.
  */
@@ -142,20 +141,16 @@ top_level_window_p (Screen *screen, Window window)
 {
   Display *dpy = DisplayOfScreen (screen);
   Window root, parent, *kids;
-  Window vroot = VirtualRootWindowOfScreen(screen);
   unsigned int nkids;
 
-  if (window == vroot)
-    return True;
-
   if (!XQueryTree (dpy, window, &root, &parent, &kids, &nkids))
     return False;
 
   if (window == root)
     return True;
 
-  /* If our direct parent is the root (or *a* root), then yes. */
-  if (parent == root || parent == vroot)
+  /* If our direct parent is the real root window, then yes. */
+  if (parent == root)
     return True;
   else
     {
@@ -183,7 +178,6 @@ top_level_window_p (Screen *screen, Window window)
 }
 
 
-
 static Bool error_handler_hit_p = False;
 static XErrorHandler old_ehandler = 0;
 static int
@@ -231,7 +225,7 @@ install_screen_colormaps (Screen *screen)
 {
   int i;
   Display *dpy = DisplayOfScreen (screen);
-  Window vroot, real_root;
+  Window real_root;
   Window parent, *kids = 0;
   unsigned int nkids = 0;
 
@@ -239,8 +233,8 @@ install_screen_colormaps (Screen *screen)
   old_ehandler = XSetErrorHandler (BadWindow_ehandler);
   error_handler_hit_p = False;
 
-  vroot = VirtualRootWindowOfScreen (screen);
-  if (XQueryTree (dpy, vroot, &real_root, &parent, &kids, &nkids))
+  real_root = XRootWindowOfScreen (screen);  /* not vroot */
+  if (XQueryTree (dpy, real_root, &real_root, &parent, &kids, &nkids))
     for (i = 0; i < nkids; i++)
       {
        XWindowAttributes xgwa;