diff options
author | Liyang HU <git@liyang.hu> | 2013-07-30 09:10:07 +0200 |
---|---|---|
committer | Liyang HU <git@liyang.hu> | 2013-07-30 09:10:07 +0200 |
commit | 6665474ea82c77db9b917e83ff51d0d24df81d2a (patch) | |
tree | 28ca79a426e4e42dd539c5c8fc02374f7a81e126 /XMonad/Layout | |
parent | f7c2abce3dd948b5105dd0dd91ac989130bf6436 (diff) | |
download | XMonadContrib-6665474ea82c77db9b917e83ff51d0d24df81d2a.tar.gz XMonadContrib-6665474ea82c77db9b917e83ff51d0d24df81d2a.tar.xz XMonadContrib-6665474ea82c77db9b917e83ff51d0d24df81d2a.zip |
XMonad.Actions.UpdatePointer: generalise updatePointer
Ignore-this: 3374a62b6c63dcc152dbf843cd0577f0
darcs-hash:20130730071007-3269f-c93d34a65590e3252ad43902e6eb499e2ba51b12.gz
Diffstat (limited to 'XMonad/Layout')
-rw-r--r-- | XMonad/Layout/MagicFocus.hs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/XMonad/Layout/MagicFocus.hs b/XMonad/Layout/MagicFocus.hs index bc9cbcd..dd897ec 100644 --- a/XMonad/Layout/MagicFocus.hs +++ b/XMonad/Layout/MagicFocus.hs @@ -28,7 +28,7 @@ import XMonad import qualified XMonad.StackSet as W import XMonad.Layout.LayoutModifier -import XMonad.Actions.UpdatePointer(updatePointer, PointerPosition(TowardsCentre)) +import XMonad.Actions.UpdatePointer (updatePointer) import Data.Monoid(All(..)) import qualified Data.Map as M @@ -75,12 +75,12 @@ swap (W.Stack f u d) focused -- This eventHook does nothing when there are floating windows on the current -- workspace. promoteWarp :: Event -> X All -promoteWarp = promoteWarp' (TowardsCentre 0.15 0.15) +promoteWarp = promoteWarp' (0.5, 0.5) (0.85, 0.85) --- | promoteWarp' allows you to specify an arbitrary PointerPosition to apply --- when the mouse enters another window. -promoteWarp' :: PointerPosition -> Event -> X All -promoteWarp' pos e@(CrossingEvent {ev_window = w, ev_event_type = t}) +-- | promoteWarp' allows you to specify an arbitrary pair of arguments to +-- pass to 'updatePointer' when the mouse enters another window. +promoteWarp' :: (Rational, Rational) -> (Rational, Rational) -> Event -> X All +promoteWarp' refPos ratio e@(CrossingEvent {ev_window = w, ev_event_type = t}) | t == enterNotify && ev_mode e == notifyNormal = do ws <- gets windowset let foc = W.peek ws @@ -88,10 +88,10 @@ promoteWarp' pos e@(CrossingEvent {ev_window = w, ev_event_type = t}) wsFloats = M.filterWithKey (\k _ -> k `elem` st) $ W.floating ws if Just w /= foc && M.null wsFloats then do windows (W.swapMaster . W.focusWindow w) - updatePointer pos + updatePointer refPos ratio return $ All False else return $ All True -promoteWarp' _ _ = return $ All True +promoteWarp' _ _ _ = return $ All True -- | Another event hook to override the focusFollowsMouse and make the pointer -- only follow if a given condition is satisfied. This could be used to disable |