From owner-freebsd-ports Wed Feb 28 10:35:57 2001 Delivered-To: freebsd-ports@freebsd.org Received: from privatecube.privatelabs.com (privatecube.privatelabs.com [63.114.185.254]) by hub.freebsd.org (Postfix) with ESMTP id 3C1C037B718; Wed, 28 Feb 2001 10:35:52 -0800 (PST) (envelope-from mi@misha.privatelabs.com) Received: from misha.privatelabs.com (root@misha.plten [10.0.0.106]) by privatecube.privatelabs.com (8.9.3/8.9.2) with ESMTP id NAA05345; Wed, 28 Feb 2001 13:51:07 -0500 Received: (from mi@localhost) by misha.privatelabs.com (8.11.1/8.11.1) id f1SIUhc68438; Wed, 28 Feb 2001 13:30:43 -0500 (EST) (envelope-from mi) From: Mikhail Teterin Message-Id: <200102281830.f1SIUhc68438@misha.privatelabs.com> Subject: netscape-remote breaks with the new KDE2.1 :( To: will@freebsd.org, kbyanc@posi.net, ports@freebsd.org Date: Wed, 28 Feb 2001 13:30:43 -0500 (EST) Cc: 21048@bugs.kde.org, jwz@netscape.com, x_cbug@netscape.com, stolcke@ICSI.Berkeley.EDU, mmm@cetia.fr MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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