• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: X11/Spaces thinks X11 windows are overlapping on different Spaces
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: X11/Spaces thinks X11 windows are overlapping on different Spaces


  • Subject: Re: X11/Spaces thinks X11 windows are overlapping on different Spaces
  • From: Greg Parker <email@hidden>
  • Date: Thu, 8 Nov 2007 01:16:36 -0800

On Nov 8, 2007, at 12:38 AM, Jeremy Huddleston wrote:
The odd thing is that the window IDs get changed at some point, and X11 looses the window name information. I tested this out on my linux box and discovered that this occurs whenever I have a WM running. When I don't have a wm (just have exec xterm in mw .xinitrc), the window list appears as I'd expect, but when I do have a WM (even a minimal one like twm), I notice the same thing (window IDs changed and names becoming null).

Most window managers wrap ("reparent") each client window inside another window created by the window manager itself. This wrapper window is where the window manager draws its window decorations (title bar, close box, etc). Your program's first query is catching its own windows before the WM reparents them.


This patch looks for a named subwindow if the top-level window didn't have a name. Works with quartz-wm.


--- xwinlist.c 2007-11-08 01:10:51.000000000 -0800
+++ xwinlist.c 2007-11-08 01:12:35.000000000 -0800
@@ -42,10 +42,24 @@
} else if(children) {
printf("X-Window Stack Order (Bottom-most first):\n");
for(i=0; i < nchildren; i++) {
-// if(children[i] == win1 || children[i] == win2) {
- XFetchName(display, children[i], &name);
- printf("Window %lu : %s\n", children[i], name);
-// }
+ XFetchName(display, children[i], &name);
+ if (!name) {
+ // window has no name - look for a child with a name
+ Window ignore;
+ Window *subchildren;
+ unsigned int nsubchildren, j;
+ s = XQueryTree(display, children[i], &ignore, &ignore, &subchildren, &nsubchildren);
+ if (s) {
+ for (j = 0; j < nsubchildren; j++) {
+ XFetchName(display, subchildren[j], &name);
+ if (name) break;
+ }
+ XFree(subchildren);
+ }
+ }
+
+ printf("Window %lu : %s\n", children[i], name);
+ if (name) XFree(name);
}
XFree(children);
children = NULL;



-- Greg Parker email@hidden Runtime Wrangler

_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list      (email@hidden)
This email sent to email@hidden


  • Follow-Ups:
    • Re: X11/Spaces thinks X11 windows are overlapping on different Spaces
      • From: Jeremy Huddleston <email@hidden>
References: 
 >X11 and Expose (From: email@hidden)
 >Re: X11 and Expose (From: "Nathaniel Gray" <email@hidden>)
 >X11/Spaces thinks X11 windows are overlapping on different Spaces (From: Jamie Kennea <email@hidden>)
 >Re: X11/Spaces thinks X11 windows are overlapping on different Spaces (From: Greg Parker <email@hidden>)
 >Re: X11/Spaces thinks X11 windows are overlapping on different Spaces (From: Jeremy Huddleston <email@hidden>)
 >Re: X11/Spaces thinks X11 windows are overlapping on different Spaces (From: Jeremy Huddleston <email@hidden>)

  • Prev by Date: Re: Announcing 1.2a7 (many bug fixes!)
  • Next by Date: RE: X11/Spaces thinks X11 windows are overlapping on differentSpaces
  • Previous by thread: Re: X11/Spaces thinks X11 windows are overlapping on different Spaces
  • Next by thread: Re: X11/Spaces thinks X11 windows are overlapping on different Spaces
  • Index(es):
    • Date
    • Thread