From eaaeb8e37037a612cf9f078919004c5910eb2e5f Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sun, 9 Mar 2025 17:04:01 -0600 Subject: Change some of how Workspaces work in WML. This change adds a "workspaceWindows" function on a pseudo-workspace level so now the windowsets '@_', '@#', '@-' actually have meaning. Also now the "move to workspace" function buffers the windows which makes things more responsive and intuitive. --- src/Rahm/Desktop/Keys.hs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/Rahm/Desktop/Keys.hs') diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs index 4848998..6dceffd 100644 --- a/src/Rahm/Desktop/Keys.hs +++ b/src/Rahm/Desktop/Keys.hs @@ -705,7 +705,7 @@ bindings = do $ do stackset <- lift $ X.windowset <$> X.get selection <- mapMaybe locationWindow <$> runKeyFeed readNextLocationSet - withBorderColorM selectedWindowsColor selection $ do + (allMovements, finalSwap) <- withBorderColorM selectedWindowsColor selection $ do lift $ addStringToPendingBuffer " " ws <- runKeyFeed readNextWorkspace finalSwap <- @@ -717,9 +717,7 @@ bindings = do _ -> return id lift $ do - (Endo allMovements) <- - mconcat - <$> mapM (fmap Endo . moveWindowToWorkspaceFn ws) selection + allMovements <- moveWindowsToWorkspaceFn ws selection setAlternateWindows selection @@ -730,19 +728,21 @@ bindings = do setAlternateWorkspace win t ) (W.findTag win stackset) - - withWindowsUnpinned selection $ - windows $ - finalSwap - . ( \ss -> - case shiftType of - ShiftAndFollow - | (w : _) <- selection, - Just ws <- W.findTag w ss -> - W.greedyView ws ss - _ -> ss - ) - . allMovements + return (allMovements, finalSwap) + + lift $ + withWindowsUnpinned selection $ + windows $ + finalSwap + . ( \ss -> + case shiftType of + ShiftAndFollow + | (w : _) <- selection, + Just ws <- W.findTag w ss -> + W.greedyView ws ss + _ -> ss + ) + . allMovements altMod $ spawnX "sudo -A systemctl suspend && xsecurelock" -- cgit