aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Hooks
diff options
context:
space:
mode:
authorJan Vornberger <jan.vornberger@informatik.uni-oldenburg.de>2010-07-27 21:41:54 +0200
committerJan Vornberger <jan.vornberger@informatik.uni-oldenburg.de>2010-07-27 21:41:54 +0200
commit5217c7c613b3559c65db9de11aec1b744df062cb (patch)
tree654785c8636f308a90c606623320cbe5f9d70490 /XMonad/Hooks
parent6933eb1d3e2b98eac9a165b4007c32629849985c (diff)
downloadXMonadContrib-5217c7c613b3559c65db9de11aec1b744df062cb.tar.gz
XMonadContrib-5217c7c613b3559c65db9de11aec1b744df062cb.tar.xz
XMonadContrib-5217c7c613b3559c65db9de11aec1b744df062cb.zip
CurrentWorkspaceOnTop: proper reimplementation of XMonad.Operation
Ignore-this: 101f55913bf836d1d87863b4c05d0665 Fixes bugs in combination with stateful layouts and floating windows darcs-hash:20100727194154-594c5-09624ed36bbbf81e245d827497a49897043a928d.gz
Diffstat (limited to 'XMonad/Hooks')
-rw-r--r--XMonad/Hooks/CurrentWorkspaceOnTop.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/XMonad/Hooks/CurrentWorkspaceOnTop.hs b/XMonad/Hooks/CurrentWorkspaceOnTop.hs
index 638a963..2c42413 100644
--- a/XMonad/Hooks/CurrentWorkspaceOnTop.hs
+++ b/XMonad/Hooks/CurrentWorkspaceOnTop.hs
@@ -26,6 +26,7 @@ import XMonad
import qualified XMonad.StackSet as S
import qualified XMonad.Util.ExtensibleState as XS
import Control.Monad(when)
+import qualified Data.Map as M
-- $usage
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
@@ -50,12 +51,18 @@ currentWorkspaceOnTop = withDisplay $ \d -> do
(CWOTS lastTag) <- XS.get
let curTag = S.tag . S.workspace . S.current $ ws
when (curTag /= lastTag) $ do
+ -- the following is more or less a reimplementation of what's happening in "XMonad.Operation"
let s = S.current ws
wsp = S.workspace s
viewrect = screenRect $ S.screenDetail s
- tmpStack = S.stack . S.workspace $ s
- (rs, _) <- runLayout wsp { S.stack = tmpStack } viewrect
- let wins = map fst rs
+ tmpStack = (S.stack wsp) >>= S.filter (`M.notMember` S.floating ws)
+ (rs, ml') <- runLayout wsp { S.stack = tmpStack } viewrect
+ updateLayout curTag ml'
+ let this = S.view curTag ws
+ fltWins = filter (flip M.member (S.floating ws)) $ S.index this
+ wins = fltWins ++ (map fst rs) -- order: first all floating windows, then the order the layout returned
+ -- end of reimplementation
+
when (not . null $ wins) $ do
io $ raiseWindow d (head wins) -- raise first window of current workspace to the very top,
io $ restackWindows d wins -- then use restackWindows to let all other windows from the workspace follow