
Hi, I'd like to have a transparent clock floating on my desktop. If I made it ignored (unmanaged), it would not be above and would be blocked by other windows. If I made it managed and float, when I floated up and down, it would be focused and I needed to press hotkey again to move focus to correct window. Anyway I could manage it, but not focusing on it? -- 竹密岂妨流水过 山高哪阻野云飞 And for G+, please use magiclouds#gmail.com.

On Sun, Jul 6, 2014 at 10:23 PM, Magicloud Magiclouds < magicloud.magiclouds@gmail.com> wrote:
I'd like to have a transparent clock floating on my desktop.
If I made it ignored (unmanaged), it would not be above and would be blocked by other windows.
If I made it managed and float, when I floated up and down, it would be focused and I needed to press hotkey again to move focus to correct window.
Anyway I could manage it, but not focusing on it?
This is difficult, because X11 expects that the way you do this is to unmanage it *and* that a window that is unmanaged knows how to manage itself. In particular, the X server may well send focus to a managed window *itself* via its window focus inheritance policy. The best xmonad could do would be to use a handleEventHook to detect the window being given focus (this might be rather difficult because focusIn and focusOut events are not currently delivered by the Haskell X11 bindings, sigh) and send focus elsewhere --- but in that case the window would still briefly receive focus. You probably need to find a clock program that knows how to operate as an unmanaged window. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Thank you for the explanation. I always thought "focus" was managed by WM.
Is "above" also controlled by X instead of WM? I tried to patch the code of
the clock to manage itself (keep itself topmost), but did not seem to work.
On Mon, Jul 7, 2014 at 10:52 AM, Brandon Allbery
On Sun, Jul 6, 2014 at 10:23 PM, Magicloud Magiclouds < magicloud.magiclouds@gmail.com> wrote:
I'd like to have a transparent clock floating on my desktop.
If I made it ignored (unmanaged), it would not be above and would be blocked by other windows.
If I made it managed and float, when I floated up and down, it would be focused and I needed to press hotkey again to move focus to correct window.
Anyway I could manage it, but not focusing on it?
This is difficult, because X11 expects that the way you do this is to unmanage it *and* that a window that is unmanaged knows how to manage itself. In particular, the X server may well send focus to a managed window *itself* via its window focus inheritance policy. The best xmonad could do would be to use a handleEventHook to detect the window being given focus (this might be rather difficult because focusIn and focusOut events are not currently delivered by the Haskell X11 bindings, sigh) and send focus elsewhere --- but in that case the window would still briefly receive focus.
You probably need to find a clock program that knows how to operate as an unmanaged window.
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
-- 竹密岂妨流水过 山高哪阻野云飞 And for G+, please use magiclouds#gmail.com.

On Sun, Jul 6, 2014 at 10:57 PM, Magicloud Magiclouds < magicloud.magiclouds@gmail.com> wrote:
Thank you for the explanation. I always thought "focus" was managed by WM.
Explicit focus is managed by the WM. But you don't explicitly choose a window to receive focus when the focused window goes away. The window manager is not invoked then, instead the server checks the focus inheritance policy *of the window that just closed*. And the default is to give focus to (the X server's idea of) the "previous window". It doesn't ask the window manager which that is, or ask the window manager to change the focused window; it determines that and assigns focus itself, and the window manager finds out about it from the subsequent FocusIn event.
Is "above" also controlled by X instead of WM? I tried to patch the code of the clock to manage itself (keep itself topmost), but did not seem to work.
Older programs do it themselves; modern programs tend to expect the window manager to do it based on EWMH hints, but xmonad does not implement the window layers part of the spec --- and it's not clear *how* to implement it in xmonad's model, as it runs into the same problems as Bug 4 (all the horrible problems with floating windows in xmonad's model). More or less, the way you'd have to do it is to call XRaiseWindow() regularly, possibly in response to any X11 event other than Expose (sending it on that event risks an infinite loop since the server will generate an Expose event if any part of your window was covered). (This kind of thing is why EWMH moved it into the window manager. Now if only we could do it right given how the StackSet works....) -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Magicloud Magiclouds
I'd like to have a transparent clock floating on my desktop.
If I made it ignored (unmanaged), it would not be above and would be blocked by other windows.
If I made it managed and float, when I floated up and down, it would be focused and I needed to press hotkey again to move focus to correct window.
Anyway I could manage it, but not focusing on it?
If you're willing to keep the window in the tiling layer I highly recommend XMonad.Layout.BoringWindows: http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Layout-BoringWindows.htm... Marking a window as boring and using the focusing functions from that module allow your focus key bindings to skip over the window. -- Peter Jones, Founder, Devalot.com Defending the honor of good code
participants (3)
-
Brandon Allbery
-
Magicloud Magiclouds
-
Peter Jones