From 6a6d913deefadd97615f54fc7fa4f4c8df9124ea Mon Sep 17 00:00:00 2001 From: philib <00philip00@gmail.com> Date: Thu, 30 Jan 2025 12:02:59 +0100 Subject: [PATCH] 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. --- CHANGES.md | 5 +++++ XMonad/Util/NamedScratchpad.hs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 6cd65e9b67..f0c84dd894 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -50,6 +50,11 @@ - Added `focusWorkspace` for focusing workspaces on the screen that they belong to. + * `XMonad.Util.NamedScratchPad` + + - Fix unintended window hiding in `nsSingleScratchpadPerWorkspace`. + Only hide the previously active scratchpad. + ## 0.18.1 (August 20, 2024) ### Breaking Changes diff --git a/XMonad/Util/NamedScratchpad.hs b/XMonad/Util/NamedScratchpad.hs index c49caa7fbc..fae82d430c 100644 --- a/XMonad/Util/NamedScratchpad.hs +++ b/XMonad/Util/NamedScratchpad.hs @@ -309,7 +309,7 @@ nsSingleScratchpadPerWorkspace :: NamedScratchpads -> X () nsSingleScratchpadPerWorkspace scratches = nsHideOnCondition $ \ _lastFocus curFocus winSet hideScratch -> do allScratchesButCurrent <- - filterM (liftA2 (<||>) (pure . (/= curFocus)) (`isNSP` scratches)) + filterM (liftA2 (<&&>) (pure . (/= curFocus)) (`isNSP` scratches)) (W.index winSet) whenX (isNSP curFocus scratches) $ for_ allScratchesButCurrent hideScratch