fix unintended window hiding

the refactoring that introduced `nsHideOnCondition` caused a
misbehaviour in `nsSingleScratchpadPerWorkspace`, leading to unintended
window hiding. Now, when opening a new scratchpad, only the previous
active scratchpad is hidden.
This commit is contained in:
philib 2025-01-30 12:02:59 +01:00
parent 4fc3642fa2
commit 6a6d913dee
2 changed files with 6 additions and 1 deletions

View File

@ -50,6 +50,11 @@
- Added `focusWorkspace` for focusing workspaces on the screen that they - Added `focusWorkspace` for focusing workspaces on the screen that they
belong to. belong to.
* `XMonad.Util.NamedScratchPad`
- Fix unintended window hiding in `nsSingleScratchpadPerWorkspace`.
Only hide the previously active scratchpad.
## 0.18.1 (August 20, 2024) ## 0.18.1 (August 20, 2024)
### Breaking Changes ### Breaking Changes

View File

@ -309,7 +309,7 @@ nsSingleScratchpadPerWorkspace :: NamedScratchpads -> X ()
nsSingleScratchpadPerWorkspace scratches = nsSingleScratchpadPerWorkspace scratches =
nsHideOnCondition $ \ _lastFocus curFocus winSet hideScratch -> do nsHideOnCondition $ \ _lastFocus curFocus winSet hideScratch -> do
allScratchesButCurrent <- allScratchesButCurrent <-
filterM (liftA2 (<||>) (pure . (/= curFocus)) (`isNSP` scratches)) filterM (liftA2 (<&&>) (pure . (/= curFocus)) (`isNSP` scratches))
(W.index winSet) (W.index winSet)
whenX (isNSP curFocus scratches) $ whenX (isNSP curFocus scratches) $
for_ allScratchesButCurrent hideScratch for_ allScratchesButCurrent hideScratch