Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X.H.ManageDocks: Deprecate individual hooks #629

Merged
merged 1 commit into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,10 @@
- Restored compatibility with pre-0.13 configs by making the startup hook
unnecessary for correct functioning (strut cache is initialized on-demand).

This is a temporary measure, however. The individual hooks are now
deprecated in favor of the `docks` combinator, `xmonad --recompile` now
reports deprecation warnings, and the hooks will be removed soon.

- Fixed ignoring of strut updates from override-redirect windows, which is
default for xmobar.

Expand Down
10 changes: 7 additions & 3 deletions XMonad/Hooks/ManageDocks.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module XMonad.Hooks.ManageDocks (
-- * Usage
-- $usage
docks, manageDocks, checkDock, AvoidStruts(..), avoidStruts, avoidStrutsOn,
docksEventHook, docksStartupHook,
ToggleStruts(..),
SetStruts(..),
module XMonad.Util.Types,
Expand All @@ -28,8 +27,11 @@ module XMonad.Hooks.ManageDocks (
RectC(..),
#endif

-- for XMonad.Actions.FloatSnap
calcGap
-- * For developers of other modules ("XMonad.Actions.FloatSnap")
calcGap,

-- * Standalone hooks (deprecated)
docksEventHook, docksStartupHook,
) where


Expand Down Expand Up @@ -157,6 +159,7 @@ checkDock = ask >>= \w -> liftX $ do

-- | Whenever a new dock appears, refresh the layout immediately to avoid the
-- new dock.
{-# DEPRECATED docksEventHook "Use docks instead." #-}
docksEventHook :: Event -> X All
docksEventHook MapNotifyEvent{ ev_window = w } = do
whenX (runQuery checkDock w <&&> (not <$> isClient w)) $
Expand All @@ -174,6 +177,7 @@ docksEventHook DestroyWindowEvent{ ev_window = w } = do
return (All True)
docksEventHook _ = return (All True)

{-# DEPRECATED docksStartupHook "Use docks instead." #-}
docksStartupHook :: X ()
docksStartupHook = void getStrutCache

Expand Down