Skip to content

Commit c2e36da

Browse files
committed
X.H.ManageDocks: Deprecate individual hooks
This will make it easier to transition to an implementation of EWMH that doesn't expose the individual hooks: X.H.ManageDocks would become a deprecated compatibility reexport of X.H.EWMH.Struts for a release or two, but the individual hooks need to be removed before that. Note that individual hooks in X.H.EwmhDesktops were deprecated earlier and individual hooks in XMonad.Hooks.UrgencyHook aren't exported any more (or perhaps never been), so this only leaves X.H.SetWMName, which unfortunately does not have a combinator interface at this point. Related: #625
1 parent 0aeaf93 commit c2e36da

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,10 @@
495495
- Restored compatibility with pre-0.13 configs by making the startup hook
496496
unnecessary for correct functioning (strut cache is initialized on-demand).
497497

498+
This is a temporary measure, however. The individual hooks are now
499+
deprecated in favor of the `docks` combinator, `xmonad --recompile` now
500+
reports deprecation warnings, and the hooks will be removed soon.
501+
498502
- Fixed ignoring of strut updates from override-redirect windows, which is
499503
default for xmobar.
500504

XMonad/Hooks/ManageDocks.hs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ module XMonad.Hooks.ManageDocks (
1717
-- * Usage
1818
-- $usage
1919
docks, manageDocks, checkDock, AvoidStruts(..), avoidStruts, avoidStrutsOn,
20-
docksEventHook, docksStartupHook,
2120
ToggleStruts(..),
2221
SetStruts(..),
2322
module XMonad.Util.Types,
@@ -28,8 +27,11 @@ module XMonad.Hooks.ManageDocks (
2827
RectC(..),
2928
#endif
3029

31-
-- for XMonad.Actions.FloatSnap
32-
calcGap
30+
-- * For developers of other modules ("XMonad.Actions.FloatSnap")
31+
calcGap,
32+
33+
-- * Standalone hooks (deprecated)
34+
docksEventHook, docksStartupHook,
3335
) where
3436

3537

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

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

180+
{-# DEPRECATED docksStartupHook "Use docks instead." #-}
177181
docksStartupHook :: X ()
178182
docksStartupHook = void getStrutCache
179183

0 commit comments

Comments
 (0)