On Aug 12, 2005, at 3:35 AM, Carsten Haitzler (The Rasterman) wrote:

note the client MUST reply by sending this to the ROOT WINDOW. thus if xscreensaver is busy listening there and getting such client messages happening on root.. guess what. it's getting the replies to e's PING's to the apps that say they want a ping. xscreensaver is needlessly complaining about it :)

Ah, I see -- I hadn't noticed that these messages were getting sent to the *real* root window, I thought they were being sent to the xscreensaver window. You're right, I ought to be ignoring those. This patch will be in the next release. Thanks!

--
Jamie Zawinski      [EMAIL PROTECTED]                  http://www.jwz.org/
                    [EMAIL PROTECTED]      http://www.dnalounge.com/
                                         http://jwz.livejournal.com/

diff -u -r1.129 xscreensaver.c
--- xscreensaver.c      9 Jul 2005 03:11:42 -0000       1.129
+++ xscreensaver.c      14 Aug 2005 21:13:51 -0000
@@ -1598,10 +1598,12 @@
 static void
 bogus_clientmessage_warning (saver_info *si, XEvent *event)
 {
+  saver_preferences *p = &si->prefs;
   char *str = XGetAtomName_safe (si->dpy, event->xclient.message_type);
   Window w = event->xclient.window;
   char wdesc[255];
   int screen = 0;
+  Bool root_p = False;
 
   *wdesc = 0;
   for (screen = 0; screen < si->nscreens; screen++)
@@ -1613,9 +1615,19 @@
     else if (w == RootWindow (si->dpy, screen))
       {
         strcpy (wdesc, "root");
+        root_p = True;
         break;
       }
 
+  /* If this ClientMessage was sent to the real root window instead of to the
+     xscreensaver window, then it might be intended for someone else who is
+     listening on the root window (e.g., the window manager).  So only print
+     the warning if: we are in debug mode; or if the bogus message was
+     actually sent to one of the xscreensaver-created windows.
+   */
+  if (root_p && !p->debug_p)
+    return;
+
   if (!*wdesc)
     {
       XErrorHandler old_handler;


Reply via email to