dtsession: screensaver don't pass random attributes to XScreenSaverSetAttributes()
authorJon Trulson <jon@radscan.com>
Sun, 6 Apr 2014 00:09:01 +0000 (18:09 -0600)
committerJon Trulson <jon@radscan.com>
Sun, 6 Apr 2014 00:09:01 +0000 (18:09 -0600)
This should fix the "tiny window appearing in the screensavers"
problem.

cde/programs/dtsession/SmMain.c

index 3b65f753f1e4437818e2b61fe622d54c932e1b7a..c1213f81a8d2c1cf252a8f4957a84d165e2b326b 100644 (file)
@@ -669,7 +669,6 @@ RegisterX11ScreenSaver(
   int screen;
   Window root;
   XID xid;
-  XSetWindowAttributes attr;
   Atom type;
 
   if (XScreenSaverQueryExtension(display, pssEventType, &ssErrorBase) &&
@@ -695,13 +694,22 @@ RegisterX11ScreenSaver(
 
     if (result == 0)
     {
+      XSetWindowAttributes attr;
+
      /* 
       * Registration successful.
       */
       XScreenSaverSelectInput(display, root, 
                               ScreenSaverNotifyMask|ScreenSaverCycleMask);
+
+      /* Even though OverrideRedirect is the default attribute in this
+       *  check, lets make sure it's set, and make sure only the
+       *  CWOverrideRedirect attr is being looked at.  The rest is
+       *  just random garbage anyway, since it's allocated from the stack.
+       */
+      attr.override_redirect = True;
       XScreenSaverSetAttributes(display, root, 0, 0, 1, 1, 0, CopyFromParent,
-                          CopyFromParent, CopyFromParent, CWBackPixel, &attr);
+                          CopyFromParent, CopyFromParent, CWOverrideRedirect, &attr);
     }
   }
   return(result);