mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 20:21:51 -07:00
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:
@@ -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"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user