X11: improve handling of WS_EX_TOPMOST
authorPeter Collingbourne <peter@pcc.me.uk>
Tue, 27 Mar 2012 18:41:55 +0000 (19:41 +0100)
committerPeter Collingbourne <peter@pcc.me.uk>
Mon, 9 Apr 2012 01:22:37 +0000 (02:22 +0100)
commit6c620c74f32908a5875c2b53f44e0b297a6a7b73
treefa3a1aa2d15eb94baa4d341f525c94e38974fa0e
parent681ea245a0d733bd20c6664dbb310bcfa4a76693
X11: improve handling of WS_EX_TOPMOST

Currently, WS_EX_TOPMOST is handled by making the window transient-for
the root window.  I was unable to find any documentation that indicated
that this would have the desired effect.  Instead, use SetTopmost to
set _NET_WM_STATE to _NET_WM_STATE_ABOVE, per EWMH.

Also, use XMapRaised to raise topmost windows to the top of the stack
when mapped, as a last ditch effort to support window managers that
do not respect _NET_WM_STATE, such as xmonad.

This fixes an issue I encountered when running a winforms application
in xmonad, whereby drop down menus would fail to re-open if windows
had been re-arranged after the menu was first opened (in reality,
the menu was hiding behind the form).
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs