1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-24 21:01:20 +00:00
freebsd-ports/www/netscape-remote/files/patch-aa
Kelly Yancey b2e8039d47 Fix netscape-remote so it works with KDE.
Submitted by:	knu
Obtained from:	KDE Bug#21048 (patch by Mikhail Teterin)
2001-05-04 06:10:06 +00:00

90 lines
2.4 KiB
Plaintext

--- remote.c.orig Wed May 2 01:47:12 2001
+++ remote.c Wed May 2 01:47:34 2001
@@ -43,8 +43,8 @@
file, you can find it at "http://home.netscape.com/newsref/std/vroot.h".
If you don't care about supporting virtual root window managers, you can
comment this line out.
- */
#include "vroot.h"
+*/
#ifdef STANDALONE
@@ -81,21 +81,26 @@
mozilla_remote_find_window (Display *dpy)
{
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;
Window tenative = 0;
unsigned char *tenative_version = 0;
- 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))
{
fprintf (stderr, "%s: XQueryTree failed on display %s\n", progname,
DisplayString (dpy));
exit (2);
}
-
- /* root != root2 is possible with virtual root WMs. */
+ } while (root != root2);
if (! (kids && nkids))
{
@@ -146,11 +151,16 @@
}
else if (tenative)
{
+#ifndef STANDALONE
+ /* no point in harassing the user when run standalone; everyone has
+ * at least netscape 1.1 by now!
+ */
fprintf (stderr,
"%s: warning: expected version %s but found version\n"
"\t%s (0x%x) instead.\n",
progname, expected_mozilla_version,
tenative_version, (unsigned int) tenative);
+#endif
XFree (tenative_version);
return tenative;
}
@@ -348,7 +358,7 @@
mozilla_remote_command (Display *dpy, Window window, const char *command,
Bool raise_p)
{
- int result;
+ int result = -1;
Bool done = False;
char *new_command = 0;
@@ -507,6 +517,8 @@
int status = 0;
mozilla_remote_init_atoms (dpy);
+ if(commands == NULL) return 0;
+
if (window == 0)
window = mozilla_remote_find_window (dpy);
else
@@ -566,7 +578,7 @@
}
-void
+int
main (int argc, char **argv)
{
Display *dpy;