Better EWMH support

Yay, SetWMName contains just what I need! Thanks Ivan, that saved me quite
some work. Now the panel switch should work even when you start with xmonad
right away, and don’t run it after metacity has run before :-]

Greetings,
Joachim
This commit is contained in:
mail
2007-10-07 09:16:48 +00:00
parent 39c0f0355b
commit 0d7daf4e27

View File

@@ -27,6 +27,8 @@ import qualified StackSet as W
import Graphics.X11.Xlib
import Graphics.X11.Xlib.Extras
import XMonadContrib.SetWMName
-- $usage
-- Add the imports to your configuration file and add the logHook:
--
@@ -51,6 +53,8 @@ ewmhDesktopsLogHook = withWindowSet $ \s -> do
let ws = sortBy (comparing W.tag) $ W.workspaces s
let wins = W.allWindows s
setSupported
-- Number of Workspaces
setNumberOfDesktops (length ws)
@@ -112,3 +116,15 @@ setWindowDesktop win i = withDisplay $ \dpy -> do
a <- getAtom "_NET_WM_DESKTOP"
c <- getAtom "CARDINAL"
io $ changeProperty32 dpy win a c propModeReplace [fromIntegral i]
setSupported :: X ()
setSupported = withDisplay $ \dpy -> do
r <- asks theRoot
a <- getAtom "_NET_SUPPORTED"
c <- getAtom "ATOM"
supp <- mapM getAtom ["_NET_WM_STATE_HIDDEN"]
io $ changeProperty32 dpy r a c propModeReplace supp
setWMName "xmonad"