mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-18 19:10:21 -07:00
Merge pull request #791 from pbrisbin/pb/desktop-viewport
Add EWMH configuration to not set _NET_DESKTOP_VIEWPORT
This commit is contained in:
commit
4e8857ecee
@ -144,6 +144,13 @@
|
||||
- Fixed an issue where the bottom right window would not respond to
|
||||
`MirrorShrink` and `MirrorExpand` messages.
|
||||
|
||||
* `XMonad.Hooks.EwmhDesktops`
|
||||
|
||||
- Added `disableEwmhManageDesktopViewport` to avoid setting the
|
||||
`_NET_DESKTOP_VIEWPORT` property, as it can lead to issues with
|
||||
some status bars (see this
|
||||
[polybar issue](https://github.com/polybar/polybar/issues/2603)).
|
||||
|
||||
### Other changes
|
||||
|
||||
## 0.17.1 (September 3, 2022)
|
||||
|
@ -40,6 +40,10 @@ module XMonad.Hooks.EwmhDesktops (
|
||||
-- $customActivate
|
||||
setEwmhActivateHook,
|
||||
|
||||
-- ** @_NET_DESKTOP_VIEWPORT@
|
||||
-- $customManageDesktopViewport
|
||||
disableEwmhManageDesktopViewport,
|
||||
|
||||
-- * Standalone hooks (deprecated)
|
||||
ewmhDesktopsStartup,
|
||||
ewmhDesktopsLogHook,
|
||||
@ -102,6 +106,8 @@ data EwmhDesktopsConfig =
|
||||
-- ^ configurable workspace rename (see 'XMonad.Hooks.StatusBar.PP.ppRename')
|
||||
, activateHook :: ManageHook
|
||||
-- ^ configurable handling of window activation requests
|
||||
, manageDesktopViewport :: Bool
|
||||
-- ^ manage @_NET_DESKTOP_VIEWPORT@?
|
||||
}
|
||||
|
||||
instance Default EwmhDesktopsConfig where
|
||||
@ -109,6 +115,7 @@ instance Default EwmhDesktopsConfig where
|
||||
{ workspaceSort = getSortByIndex
|
||||
, workspaceRename = pure pure
|
||||
, activateHook = doFocus
|
||||
, manageDesktopViewport = True
|
||||
}
|
||||
|
||||
|
||||
@ -228,6 +235,26 @@ setEwmhWorkspaceRename f = XC.modifyDef $ \c -> c{ workspaceRename = f }
|
||||
setEwmhActivateHook :: ManageHook -> XConfig l -> XConfig l
|
||||
setEwmhActivateHook h = XC.modifyDef $ \c -> c{ activateHook = h }
|
||||
|
||||
-- $customManageDesktopViewport
|
||||
-- Setting @_NET_DESKTOP_VIEWPORT@ is typically desired but can lead to a
|
||||
-- confusing workspace list in polybar, where this information is used to
|
||||
-- re-group the workspaces by monitor. See
|
||||
-- <https://github.com/polybar/polybar/issues/2603 polybar#2603>.
|
||||
--
|
||||
-- To avoid this, you can use:
|
||||
--
|
||||
-- > main = xmonad $ … . disableEwmhManageDesktopViewport . ewmh . … $ def{…}
|
||||
--
|
||||
-- Note that if you apply this configuration in an already running environment,
|
||||
-- the property may remain at its previous value. It can be removed by running:
|
||||
--
|
||||
-- > xprop -root -remove _NET_DESKTOP_VIEWPORT
|
||||
--
|
||||
-- Which should immediately fix your bar.
|
||||
--
|
||||
disableEwmhManageDesktopViewport :: XConfig l -> XConfig l
|
||||
disableEwmhManageDesktopViewport = XC.modifyDef $ \c -> c{ manageDesktopViewport = False }
|
||||
|
||||
|
||||
-- | Initializes EwmhDesktops and advertises EWMH support to the X server.
|
||||
{-# DEPRECATED ewmhDesktopsStartup "Use ewmh instead." #-}
|
||||
@ -303,7 +330,7 @@ whenChanged :: (Eq a, ExtensionClass a) => a -> X () -> X ()
|
||||
whenChanged = whenX . XS.modified . const
|
||||
|
||||
ewmhDesktopsLogHook' :: EwmhDesktopsConfig -> X ()
|
||||
ewmhDesktopsLogHook' EwmhDesktopsConfig{workspaceSort, workspaceRename} = withWindowSet $ \s -> do
|
||||
ewmhDesktopsLogHook' EwmhDesktopsConfig{workspaceSort, workspaceRename, manageDesktopViewport} = withWindowSet $ \s -> do
|
||||
sort' <- workspaceSort
|
||||
let ws = sort' $ W.workspaces s
|
||||
|
||||
@ -365,9 +392,10 @@ ewmhDesktopsLogHook' EwmhDesktopsConfig{workspaceSort, workspaceRename} = withWi
|
||||
whenChanged (ActiveWindow activeWindow') $ setActiveWindow activeWindow'
|
||||
|
||||
-- Set desktop Viewport
|
||||
let visibleScreens = W.current s : W.visible s
|
||||
currentTags = map (W.tag . W.workspace) visibleScreens
|
||||
whenChanged (MonitorTags currentTags) $ mkViewPorts s (map W.tag ws)
|
||||
when manageDesktopViewport $ do
|
||||
let visibleScreens = W.current s : W.visible s
|
||||
currentTags = map (W.tag . W.workspace) visibleScreens
|
||||
whenChanged (MonitorTags currentTags) $ mkViewPorts s (map W.tag ws)
|
||||
|
||||
-- | Create the viewports from the current 'WindowSet' and a list of
|
||||
-- already sorted workspace IDs.
|
||||
|
Loading…
x
Reference in New Issue
Block a user