mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-31 03:13:47 -07:00
WindowArranger: add a SetGeometry message - needed to enable mouseDrag
This commit is contained in:
@@ -90,6 +90,7 @@ data WindowArrangerMsg = DeArrange
|
|||||||
| MoveRight Int
|
| MoveRight Int
|
||||||
| MoveUp Int
|
| MoveUp Int
|
||||||
| MoveDown Int
|
| MoveDown Int
|
||||||
|
| SetGeometry Rectangle
|
||||||
deriving ( Typeable )
|
deriving ( Typeable )
|
||||||
instance Message WindowArrangerMsg
|
instance Message WindowArrangerMsg
|
||||||
|
|
||||||
@@ -103,7 +104,7 @@ data WindowArranger a = WA Bool ArrangeAll [ArrangedWindow a] deriving (Read, Sh
|
|||||||
instance (Show a, Read a, Eq a) => LayoutModifier WindowArranger a where
|
instance (Show a, Read a, Eq a) => LayoutModifier WindowArranger a where
|
||||||
pureModifier (WA True b []) _ _ wrs = arrangeWindows b wrs
|
pureModifier (WA True b []) _ _ wrs = arrangeWindows b wrs
|
||||||
|
|
||||||
pureModifier (WA True b awrs) _ (S.Stack w _ _) wrs = curry process wrs awrs
|
pureModifier (WA True b awrs) _ (S.Stack w _ _) wrs = curry process wrs awrs
|
||||||
where
|
where
|
||||||
wins = map fst *** map awrWin
|
wins = map fst *** map awrWin
|
||||||
update (a,r) = mkNewAWRs b a *** removeAWRs r >>> uncurry (++)
|
update (a,r) = mkNewAWRs b a *** removeAWRs r >>> uncurry (++)
|
||||||
@@ -134,6 +135,9 @@ instance (Show a, Read a, Eq a) => LayoutModifier WindowArranger a where
|
|||||||
fa = fromAWR wr
|
fa = fromAWR wr
|
||||||
chk x y = fi $ max 1 (fi x - y)
|
chk x y = fi $ max 1 (fi x - y)
|
||||||
|
|
||||||
|
pureMess (WA t b (wr:wrs)) m
|
||||||
|
| Just (SetGeometry r) <- fromMessage m, (w,_) <- fromAWR wr = Just . WA t b $ AWR (w,r):wrs
|
||||||
|
|
||||||
pureMess (WA _ b l) m
|
pureMess (WA _ b l) m
|
||||||
| Just DeArrange <- fromMessage m = Just $ WA False b l
|
| Just DeArrange <- fromMessage m = Just $ WA False b l
|
||||||
| Just Arrange <- fromMessage m = Just $ WA True b l
|
| Just Arrange <- fromMessage m = Just $ WA True b l
|
||||||
|
Reference in New Issue
Block a user