diff options
author | Jan Vornberger <jan.vornberger@informatik.uni-oldenburg.de> | 2009-12-23 15:54:28 +0100 |
---|---|---|
committer | Jan Vornberger <jan.vornberger@informatik.uni-oldenburg.de> | 2009-12-23 15:54:28 +0100 |
commit | cbca3f90da8a21d5b5d929748604aec78ccb0ebb (patch) | |
tree | 1c984902ef3f769ff7fb2c43224e4ff95308e93d /XMonad/Layout | |
parent | be8064767c77a02987f9eae7392f5d479ce9d5be (diff) | |
download | XMonadContrib-cbca3f90da8a21d5b5d929748604aec78ccb0ebb.tar.gz XMonadContrib-cbca3f90da8a21d5b5d929748604aec78ccb0ebb.tar.xz XMonadContrib-cbca3f90da8a21d5b5d929748604aec78ccb0ebb.zip |
Let the core know about MouseResizableTile's draggers, so they are stacked correctly
Ignore-this: 7c096aba6b540ccf9b49c4ee86c6091a
darcs-hash:20091223145428-594c5-e07060de0b18fd68d045ef5afbf05ecb44c1679f.gz
Diffstat (limited to '')
-rw-r--r-- | XMonad/Layout/MouseResizableTile.hs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/XMonad/Layout/MouseResizableTile.hs b/XMonad/Layout/MouseResizableTile.hs index 3a3381f..3b02927 100644 --- a/XMonad/Layout/MouseResizableTile.hs +++ b/XMonad/Layout/MouseResizableTile.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses, PatternGuards #-} +{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses, PatternGuards, TypeSynonymInstances #-} ---------------------------------------------------------------------------- -- | -- Module : XMonad.Layout.MouseResizableTile @@ -25,6 +25,7 @@ module XMonad.Layout.MouseResizableTile ( import XMonad hiding (tile, splitVertically, splitHorizontallyBy) import qualified XMonad.StackSet as W import XMonad.Util.XUtils +import Control.Applicative((<$>)) -- $usage -- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: @@ -100,7 +101,7 @@ mouseResizableTile = MRT 1 mrtFraction [] [] [] 0 0 False mouseResizableTileMirrored :: MouseResizableTile a mouseResizableTileMirrored= MRT 1 mrtFraction [] [] [] 0 0 True -instance LayoutClass MouseResizableTile a where +instance LayoutClass MouseResizableTile Window where doLayout state sr (W.Stack w l r) = let wins = reverse l ++ w : r num = length wins @@ -111,10 +112,12 @@ instance LayoutClass MouseResizableTile a where rects' = map (mirrorAdjust id mirrorRect . sanitizeRectangle sr') rects in do mapM_ deleteDragger $ draggers state - newDraggers <- mapM (createDragger sr . adjustForMirror (isMirrored state)) preparedDraggers - return (zip wins rects', Just $ state { draggers = newDraggers, - focusPos = length l, - numWindows = length wins }) + (draggerWrs, newDraggers) <- unzip <$> mapM + (createDragger sr . adjustForMirror (isMirrored state)) + preparedDraggers + return (zip wins rects' ++ draggerWrs, Just $ state { draggers = newDraggers, + focusPos = length l, + numWindows = length wins }) where mirrorAdjust a b = if (isMirrored state) then b @@ -227,11 +230,11 @@ splitHorizontallyBy f (Rectangle sx sy sw sh) = ((leftHalf, rightHalf), (dragger draggerRect = Rectangle (sx + fromIntegral leftw - mrtDraggerOffset) sy mrtDraggerSize sh draggerInfo = MasterDragger sx (fromIntegral sw) -createDragger :: Rectangle -> DraggerWithRect -> X DraggerWithWin +createDragger :: Rectangle -> DraggerWithRect -> X ((Window, Rectangle), DraggerWithWin) createDragger sr (draggerRect, draggerCursor, draggerInfo) = do - draggerWin <- createInputWindow draggerCursor $ sanitizeRectangle sr draggerRect - io . flip lowerWindow draggerWin =<< asks display - return (draggerWin, draggerInfo) + let draggerRect' = sanitizeRectangle sr draggerRect + draggerWin <- createInputWindow draggerCursor draggerRect' + return ((draggerWin, draggerRect'), (draggerWin, draggerInfo)) deleteDragger :: DraggerWithWin -> X () deleteDragger (draggerWin, _) = deleteWindow draggerWin |