override-redirect issues in Xquartz

Adam Jackson ajax at nwnk.net
Fri Oct 17 07:57:30 PDT 2008


On Thu, 2008-10-16 at 14:13 -0700, Jeremy Huddleston wrote:

> The problem is that windows following this route don't get handled by  
> our WM and don't get their native windows parented properly by quartz- 
> wm.  When a window sets WM_TRANSIENT_FOR, we set its native window as  
> a child to its parent's native window so the menu "belongs to" and  
> "moves with" the parent.  This works fine for nedit's Open dialog for  
> example.  Menus that don't set WM_TRANSIENT_FOR and follow this  
> override-redirect approach don't get parented properly and cause  
> problems (like the menu appearing in the wrong Space [virtual desktop]  
> because that's the Space it was last rendered in and thus the native  
> window bound to).
> 
> We need a way to bind the native window for this menu to the native  
> window for its parent.  Currently it is just bound to the Space in  
> which it is first rendered... so does anyone have some suggestions for  
> the least invasive way to go about this?  Doing some quick  
> investigation with xwininfo on the window, I see no wm hints, and it's  
> parent window id is the root window... so... yick.

Yeah, menus are typically children of the root, because if they were
children of the toplevel they'd be clipped to within the toplevel.
Lame, eh?

You can probably get most of the way towards the right behaviour by
treating o-r windows as logical children of the most-recently-active
toplevel window of the app with the same XID allocation (if one exists).
Menus generally don't appear over windows other than the one you're
interacting with, nor do they tend to get created by one client on
behalf of another.

In an MPX world you'd need to track "most-recently-active" per focus
group, but MPX under OSX is probably a fair way off.

I can't really think of a good way to always get this right without
changing applications though, or at least toolkits.  No reason we can't
set TRANSIENT_FOR even for o-r windows I think...

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20081017/e1aca509/attachment.pgp>


More information about the xorg mailing list