[xmonad] Move EWMH support initialization to a startupHook

Wirt Wolff wirtwolff at gmail.com
Thu Oct 22 02:20:48 EDT 2009


Excerpts from Justin Bogner's message of Sat Oct 10 23:44:51 -0600 2009:
> This patch will break existing configs.
> 
> EwhmDesktops.setSupported sets some X atoms to constants. This should
> rightfully be done once, in a startup hook, rather than repeatedly in
> the log hook. This complicates the user configs a bit (though they can
> just use Config.Desktop) but fixes problems like setWMName having to be
> called in the log hook if ewmh is being used.

This would be great to have in 0.9 if it can be evaluated in time. It's 
a much better way to handle the constants. It's also good to spread out
config breakers across releases, and we don't have many for 0.9 as it
stands currently; this would be a good time for such a change.

I'm going to test it out with gnome-panel, trayer, and perhaps some 
other desktops over the next few days, but wanted to give you a heads
up, Justin, that it would be good to send a new patch reconciling with
recent change to Config.Desktop.

The recent mouse cursor patches modified the desktopConfig startupHook
creating a conflict.  I don't think it should conflict with the C.Desktop
documentation patch I just sent, but haven't tested that yet.
Here's how I resolved it:

-    { logHook    = ewmhDesktopsLogHook
-    , layoutHook = desktopLayoutModifiers $ layoutHook defaultConfig
-    , manageHook = manageHook defaultConfig <+> manageDocks
+    { startupHook     = setDefaultCursor xC_left_ptr >> ewmhDesktopsStartup
+    , logHook         = ewmhDesktopsLogHook
+    , layoutHook      = desktopLayoutModifiers $ layoutHook defaultConfig
+    , manageHook      = manageHook defaultConfig <+> manageDocks

It also sets a few new atoms as supported, so as much as I hate to say it
and prolong the hideous logHook = setWMName "xmonad" >> setWMName "LG3D"
nonsense, it is tempting to postpone this change to give more time in
darcs for settling.

regards,
-- 
wmw


More information about the xmonad mailing list