summaryrefslogtreecommitdiffstats
path: root/lib/EwmhDesktops.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/EwmhDesktops.hs')
-rw-r--r--lib/EwmhDesktops.hs27
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/EwmhDesktops.hs b/lib/EwmhDesktops.hs
index 334233d..12b1688 100644
--- a/lib/EwmhDesktops.hs
+++ b/lib/EwmhDesktops.hs
@@ -36,6 +36,8 @@ import XMonad.Util.XUtils (fi)
import XMonad.Util.WorkspaceCompare
import XMonad.Util.WindowProperties (getProp32)
+import DynamicPerScreenWorkspaces
+
-- $usage
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
--
@@ -48,10 +50,10 @@ import XMonad.Util.WindowProperties (getProp32)
-- | Add EWMH functionality to the given config. See above for an example.
-ewmh :: XConfig a -> XConfig a
-ewmh c = c { startupHook = startupHook c +++ ewmhDesktopsStartup
- , handleEventHook = handleEventHook c +++ ewmhDesktopsEventHook
- , logHook = logHook c +++ ewmhDesktopsLogHook }
+ewmh :: DynamicWorkspaceConfig -> XConfig a -> XConfig a
+ewmh dwc c = c { startupHook = startupHook c +++ ewmhDesktopsStartup
+ , handleEventHook = handleEventHook c +++ ewmhDesktopsEventHook dwc
+ , logHook = logHook c +++ ewmhDesktopsLogHook }
where x +++ y = mappend x y
-- |
@@ -105,11 +107,11 @@ ewmhDesktopsLogHook = withWindowSet $ \s -> do
--
-- * _NET_ACTIVE_WINDOW (activate another window, changing workspace if needed)
--
-ewmhDesktopsEventHook :: Event -> X All
-ewmhDesktopsEventHook e = handle e >> return (All True)
+ewmhDesktopsEventHook :: DynamicWorkspaceConfig -> Event -> X All
+ewmhDesktopsEventHook dwc e = handle dwc e >> return (All True)
-handle :: Event -> X ()
-handle ClientMessageEvent {
+handle :: DynamicWorkspaceConfig -> Event -> X ()
+handle dwc ClientMessageEvent {
ev_window = w,
ev_message_type = mt,
ev_data = d
@@ -125,7 +127,9 @@ handle ClientMessageEvent {
if mt == a_cd then do
let n = head d
if 0 <= n && fi n < length ws then
- windows $ W.view (W.tag (ws !! fi n))
+ --windows $ W.view (W.tag (ws !! fi n))
+ --view dwc $ fi n
+ return ()
else trace $ "Bad _NET_CURRENT_DESKTOP with data[0]="++show n
else if mt == a_d then do
let n = head d
@@ -133,7 +137,8 @@ handle ClientMessageEvent {
windows $ W.shiftWin (W.tag (ws !! fi n)) w
else trace $ "Bad _NET_DESKTOP with data[0]="++show n
else if mt == a_aw then do
- windows $ W.focusWindow w
+ --windows $ W.focusWindow w
+ focusWindow dwc w
else if mt == a_cw then do
killWindow w
else if mt `elem` a_ignore then do
@@ -142,7 +147,7 @@ handle ClientMessageEvent {
-- The Message is unknown to us, but that is ok, not all are meant
-- to be handled by the window manager
return ()
-handle _ = return ()
+handle _ _ = return ()
-- |
-- An event hook to handle applications that wish to fullscreen using the