mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
Merge pull request #924 from m1mir/feat/independentDoFocus
X.L.IndependentScreens: Add doFocus' ManageHook.
This commit is contained in:
commit
9d457a73ce
@ -49,6 +49,8 @@
|
|||||||
|
|
||||||
- Added `focusWorkspace` for focusing workspaces on the screen that they
|
- Added `focusWorkspace` for focusing workspaces on the screen that they
|
||||||
belong to.
|
belong to.
|
||||||
|
- Added `doFocus'` hook as an alternative for `doFocus` when using
|
||||||
|
IndependentScreens.
|
||||||
|
|
||||||
* `XMonad.Util.NamedScratchPad`
|
* `XMonad.Util.NamedScratchPad`
|
||||||
|
|
||||||
|
@ -238,8 +238,8 @@ setEwmhWorkspaceRename f = XC.modifyDef $ \c -> c{ workspaceRename = f }
|
|||||||
-- > [ className =? "Google-chrome" <||> className =? "google-chrome" -?> doAskUrgent
|
-- > [ className =? "Google-chrome" <||> className =? "google-chrome" -?> doAskUrgent
|
||||||
-- > , pure True -?> doFocus ]
|
-- > , pure True -?> doFocus ]
|
||||||
--
|
--
|
||||||
-- See "XMonad.ManageHook", "XMonad.Hooks.ManageHelpers" and "XMonad.Hooks.Focus"
|
-- See "XMonad.ManageHook", "XMonad.Hooks.ManageHelpers", "XMonad.Hooks.Focus" and
|
||||||
-- for functions that can be useful here.
|
-- "XMonad.Layout.IndependentScreens" for functions that can be useful here.
|
||||||
|
|
||||||
-- | Set (replace) the hook which is invoked when a client sends a
|
-- | Set (replace) the hook which is invoked when a client sends a
|
||||||
-- @_NET_ACTIVE_WINDOW@ request to activate a window. The default is 'doFocus'
|
-- @_NET_ACTIVE_WINDOW@ request to activate a window. The default is 'doFocus'
|
||||||
|
@ -27,7 +27,7 @@ module XMonad.Layout.IndependentScreens (
|
|||||||
whenCurrentOn,
|
whenCurrentOn,
|
||||||
countScreens,
|
countScreens,
|
||||||
workspacesOn,
|
workspacesOn,
|
||||||
workspaceOnScreen, focusWindow', focusScreen, focusWorkspace, nthWorkspace, withWspOnScreen,
|
workspaceOnScreen, focusWindow', doFocus', focusScreen, focusWorkspace, nthWorkspace, withWspOnScreen,
|
||||||
-- * Converting between virtual and physical workspaces
|
-- * Converting between virtual and physical workspaces
|
||||||
-- $converting
|
-- $converting
|
||||||
marshall, unmarshall, unmarshallS, unmarshallW,
|
marshall, unmarshall, unmarshallS, unmarshallW,
|
||||||
@ -160,6 +160,11 @@ focusWindow' window ws
|
|||||||
Just tag -> W.focusWindow window $ focusScreen (unmarshallS tag) ws
|
Just tag -> W.focusWindow window $ focusScreen (unmarshallS tag) ws
|
||||||
Nothing -> ws
|
Nothing -> ws
|
||||||
|
|
||||||
|
-- | ManageHook to focus a window, switching workspace on the correct Xinerama screen if neccessary.
|
||||||
|
-- Useful in 'XMonad.Hooks.EwmhDesktops.setActivateHook' when using this module.
|
||||||
|
doFocus' :: ManageHook
|
||||||
|
doFocus' = doF . focusWindow' =<< ask
|
||||||
|
|
||||||
-- | Focus a given screen.
|
-- | Focus a given screen.
|
||||||
focusScreen :: ScreenId -> WindowSet -> WindowSet
|
focusScreen :: ScreenId -> WindowSet -> WindowSet
|
||||||
focusScreen screenId = withWspOnScreen screenId W.view
|
focusScreen screenId = withWspOnScreen screenId W.view
|
||||||
|
Loading…
x
Reference in New Issue
Block a user