mirror of
https://github.com/xmonad/xmonad.git
synced 2025-07-25 17:21:52 -07:00
Adds withUnfocused function to XMonad.Operations
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
## unknown (unknown)
|
||||
|
||||
* Adds `withUnfocused` function to `XMonad.Operations`, allowing for
|
||||
`X` operations to be applied to all unfocused windows.
|
||||
|
||||
* Fixed a bug when using multiple screens with different dimensions,
|
||||
causing some floating windows to be smaller/larger than the size they
|
||||
requested.
|
||||
|
@@ -21,7 +21,7 @@ module XMonad.Operations (
|
||||
setTopFocus, focus, withFocused,
|
||||
|
||||
-- * Manage Windows
|
||||
windows, refresh, rescreen, modifyWindowSet, windowBracket, windowBracket_, clearEvents, getCleanedScreenInfo,
|
||||
windows, refresh, rescreen, modifyWindowSet, windowBracket, windowBracket_, clearEvents, getCleanedScreenInfo, withUnfocused,
|
||||
|
||||
-- * Keyboard and Mouse
|
||||
cleanMask, extraModifiers,
|
||||
@@ -481,6 +481,13 @@ screenWorkspace sc = withWindowSet $ return . W.lookupWorkspace sc
|
||||
withFocused :: (Window -> X ()) -> X ()
|
||||
withFocused f = withWindowSet $ \w -> whenJust (W.peek w) f
|
||||
|
||||
-- | Apply an 'X' operation to all unfocused windows, if there are any.
|
||||
withUnfocused :: (Window -> X ()) -> X ()
|
||||
withUnfocused f = withWindowSet $ \ws ->
|
||||
whenJust (W.peek ws) $ \w ->
|
||||
let unfocusedWindows = filter (/= w) $ W.index ws
|
||||
in mapM_ f unfocusedWindows
|
||||
|
||||
-- | Is the window is under management by xmonad?
|
||||
isClient :: Window -> X Bool
|
||||
isClient w = withWindowSet $ return . W.member w
|
||||
|
Reference in New Issue
Block a user