X.H.IndependentScreens: Added screenOnMonitor to the export list.

This commit is contained in:
m1mir 2025-02-08 17:20:40 +01:00
parent 195a0ac3c0
commit b1bf33d6eb
No known key found for this signature in database
GPG Key ID: 37B3DD718AB21563
3 changed files with 5 additions and 5 deletions

View File

@ -54,6 +54,7 @@
belong to. belong to.
- Added `doFocus'` hook as an alternative for `doFocus` when using - Added `doFocus'` hook as an alternative for `doFocus` when using
IndependentScreens. IndependentScreens.
- Added `screenOnMonitor` for getting the active screen for a monitor.
* `XMonad.Util.NamedScratchPad` * `XMonad.Util.NamedScratchPad`

View File

@ -335,11 +335,10 @@ disableEwmhManageDesktopViewport = XC.modifyDef $ \c -> c{ manageDesktopViewport
-- > import XMonad.Layout.IndependentScreens -- > import XMonad.Layout.IndependentScreens
-- > -- >
-- > customMapper :: WindowSet -> (WindowSpace -> WindowScreen) -- > customMapper :: WindowSet -> (WindowSpace -> WindowScreen)
-- > customMapper winset (Workspace wsid _ _) = fromMaybe (W.current winset) screenOnMonitor -- > customMapper winset (Workspace wsid _ _) = fromMaybe (W.current winset) maybeMappedScreen
-- > where -- > where
-- > screenId = unmarshallS wsid -- > screenId = unmarshallS wsid
-- > screenOnMonitor :: Maybe WindowScreen -- > maybeMappedScreen = screenOnMonitor screenId winset
-- > screenOnMonitor = find ((screenId ==) . W.screen) (W.current winset : W.visible winset)
-- > -- >
-- > -- >
-- > main = xmonad $ ... . setEwmhHiddenWorkspaceToScreenMapping customMapper . ewmh . ... $ def{...} -- > main = xmonad $ ... . setEwmhHiddenWorkspaceToScreenMapping customMapper . ewmh . ... $ def{...}

View File

@ -26,7 +26,7 @@ module XMonad.Layout.IndependentScreens (
marshallPP, marshallPP,
whenCurrentOn, whenCurrentOn,
countScreens, countScreens,
workspacesOn, workspacesOn, screenOnMonitor,
workspaceOnScreen, focusWindow', doFocus', 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
@ -148,7 +148,7 @@ withWspOnScreen screenId operation ws = case workspaceOnScreen screenId ws of
Just wsp -> operation wsp ws Just wsp -> operation wsp ws
Nothing -> ws Nothing -> ws
-- | Get the workspace that is active on a given screen. -- | Get the screen that is active on a given monitor.
screenOnMonitor :: ScreenId -> WindowSet -> Maybe WindowScreen screenOnMonitor :: ScreenId -> WindowSet -> Maybe WindowScreen
screenOnMonitor screenId ws = find ((screenId ==) . W.screen) (W.current ws : W.visible ws) screenOnMonitor screenId ws = find ((screenId ==) . W.screen) (W.current ws : W.visible ws)