Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Feb 2001 13:30:43 -0500 (EST)
From:      Mikhail Teterin <mi@misha.privatelabs.com>
To:        will@freebsd.org, kbyanc@posi.net, ports@freebsd.org
Cc:        21048@bugs.kde.org, jwz@netscape.com, x_cbug@netscape.com, stolcke@ICSI.Berkeley.EDU, mmm@cetia.fr
Subject:   netscape-remote breaks with the new KDE2.1 :(
Message-ID:  <200102281830.f1SIUhc68438@misha.privatelabs.com>

next in thread | raw e-mail | index | archive | help
Hello!

The KDE  bug #21048, that  I just filed, probably,  has less to  do with
KDE, than  with netscape-remote  itself. I don't  know enough  about X11
calls to be certain, however.

The problem is, with the new KDE, attempts to use netscape -remote fail
with:

communicator-linux-4_76_bin: root window has no children on display :0.0

The same problem, of course, exists for our netscape-remote. For some
reason, the root window, as reported by the horrors of

	RootWindowOfScreen (DefaultScreenOfDisplay (dpy))

or the simple

	DefaultRootWindow(dpy)

is not "quite" the root window :) The later call to

	XQueryTree (dpy, root, &root2, &parent, &kids, &nkids))

returns the correct root window in root2. A comment in the file says:

	/* root != root2 is possible with virtual root WMs. */

but nothing there handles this scenario.

Please, examine the attached patch (it incorporates the existing FreeBSD
port's  files/patch-aa),  which   (besides  silencing  some  compilation
warnings) makes mozilla_remote_find_window loop until the returned root2
is the  same as the  given root. This is  either immediately, or  at the
second run (from my observations), so I did not put any provisions there
to ensure it stops after a certain number of attempts.

Can  someone  explain  to  me,  why xlsclients(1)  does  not  need  this
and  always  gets the  root  window  directly  from  the first  call  to
DefaultRootWindow(dpy)? Thanks!

	-mi

--- remote.c	Sat Jun 22 00:00:00 1996
+++ remote.c	Wed Feb 28 12:52:38 2001
@@ -45,4 +45,4 @@
    comment this line out.
- */
 #include "vroot.h"
+*/
 
@@ -83,5 +83,5 @@
   int i;
-  Window root = RootWindowOfScreen (DefaultScreenOfDisplay (dpy));
-  Window root2, parent, *kids;
-  unsigned int nkids;
+  Window root, root2 = DefaultRootWindow(dpy);
+  Window parent, *kids = NULL;
+  unsigned int nkids = 0;
   Window result = 0;
@@ -90,3 +90,9 @@
 
-  if (! XQueryTree (dpy, root, &root2, &parent, &kids, &nkids))
+  /* root != root2 is possible with virtual root WMs. */
+  /* turns out, we need to get to the bottom -- the very top root window */
+  /* what continues to puzzle me, is that xlsclients works without this -- */
+  /* The DefaultRootWindow(dpy) always returns the right thing to it... */
+  do {
+    root = root2;
+    if (! XQueryTree (dpy, root, &root2, &parent, &kids, &nkids))
     {
@@ -96,4 +102,3 @@
     }
-
-  /* root != root2 is possible with virtual root WMs. */
+  } while (root != root2);
 
@@ -148,2 +153,6 @@
     {
+#ifndef STANDALONE
+      /* no point in harassing the user when run standalone; everyone has
+       * at least netscape 1.1 by now!
+       */
       fprintf (stderr,
@@ -153,2 +162,3 @@
 	       tenative_version, (unsigned int) tenative);
+#endif
       XFree (tenative_version);
@@ -350,3 +360,3 @@
 {
-  int result;
+  int result = -1;
   Bool done = False;
@@ -509,2 +519,4 @@
 
+  if(commands == NULL) return 0;
+
   if (window == 0)
@@ -568,3 +580,3 @@
 
-void
+int
 main (int argc, char **argv)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102281830.f1SIUhc68438>