mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 08:30:21 -07:00
Add function to detect floating windows in ManageHook
Add a willFloat function to deteect whether the managed window will be floating or not Add description of added change to CHANGES.md
This commit is contained in:
parent
eee0a0dc39
commit
b6af6bb86a
@ -51,6 +51,9 @@
|
|||||||
* Added `withUnfocused` function to `XMonad.Operations`, allowing for `X`
|
* Added `withUnfocused` function to `XMonad.Operations`, allowing for `X`
|
||||||
operations to be applied to unfocused windows.
|
operations to be applied to unfocused windows.
|
||||||
|
|
||||||
|
* Added `willFloat` function to `XMonad.ManageHooks` to detect whether the
|
||||||
|
(about to be) managed window will be a floating window or not
|
||||||
|
|
||||||
[these build scripts]: https://github.com/xmonad/xmonad-testing/tree/master/build-scripts
|
[these build scripts]: https://github.com/xmonad/xmonad-testing/tree/master/build-scripts
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
@ -106,6 +106,14 @@ getStringProperty d w p = do
|
|||||||
md <- io $ getWindowProperty8 d a w
|
md <- io $ getWindowProperty8 d a w
|
||||||
return $ fmap (map (toEnum . fromIntegral)) md
|
return $ fmap (map (toEnum . fromIntegral)) md
|
||||||
|
|
||||||
|
-- | Return whether the window will be a floating window or not
|
||||||
|
willFloat :: Query Bool
|
||||||
|
willFloat = ask >>= \w -> liftX $ withDisplay $ \d -> do
|
||||||
|
sh <- io $ getWMNormalHints d w
|
||||||
|
let isFixedSize = isJust (sh_min_size sh) && sh_min_size sh == sh_max_size sh
|
||||||
|
isTransient <- isJust <$> io (getTransientForHint d w)
|
||||||
|
return (isFixedSize || isTransient)
|
||||||
|
|
||||||
-- | Modify the 'WindowSet' with a pure function.
|
-- | Modify the 'WindowSet' with a pure function.
|
||||||
doF :: (s -> s) -> Query (Endo s)
|
doF :: (s -> s) -> Query (Endo s)
|
||||||
doF = return . Endo
|
doF = return . Endo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user