diff options
| author | Josh Rahm <rahm@josher.dev> | 2026-04-28 17:31:57 -0600 |
|---|---|---|
| committer | Josh Rahm <rahm@josher.dev> | 2026-04-28 17:31:57 -0600 |
| commit | 9e1175f878e4a4b24a9486e969d96a9df1fec34c (patch) | |
| tree | 1b6b3175d296bf9bff83706ca2187c8e7a0f9497 /src/Rahm/Desktop/Keys.hs | |
| parent | b173b7ddac441e9d6649b22029d08d4be7aa8431 (diff) | |
| download | rde-9e1175f878e4a4b24a9486e969d96a9df1fec34c.tar.gz rde-9e1175f878e4a4b24a9486e969d96a9df1fec34c.tar.bz2 rde-9e1175f878e4a4b24a9486e969d96a9df1fec34c.zip | |
[feat] properly color the borders when swapping windows.
Diffstat (limited to 'src/Rahm/Desktop/Keys.hs')
| -rw-r--r-- | src/Rahm/Desktop/Keys.hs | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/Rahm/Desktop/Keys.hs b/src/Rahm/Desktop/Keys.hs index 5fcea5a..ae06b9d 100644 --- a/src/Rahm/Desktop/Keys.hs +++ b/src/Rahm/Desktop/Keys.hs @@ -45,7 +45,7 @@ import Graphics.X11.ExtraTypes.XF86 xF86XK_MonBrightnessUp, ) import Graphics.X11.XScreenSaver (XScreenSaverState (ScreenSaverCycle)) -import Rahm.Desktop.BorderColors (BorderColor (BorderColor), withBorderColor, withBorderColorM) +import Rahm.Desktop.BorderColors (BorderColor (BorderColor), withBorderColor) import Rahm.Desktop.Common ( Location (..), Xish (liftFromX), @@ -386,17 +386,18 @@ bindings = do logs Debug "No swap buddy for %s" (show current) ) $ do - l1 <- mapMaybe (\(Location _ w) -> w) <$> readNextLocationSet - liftFromX $ addStringToPendingBuffer " " - l2 <- mapMaybe (\(Location _ w) -> w) <$> readNextLocationSet - let (l1', l2') = - if length l1 > length l2 - then (l1, l2) - else (l2, l1) - l1'' = filter (not . (`elem` l2')) l1' - in liftFromX $ do - setAlternateWindows (l1'' ++ l2') - swapWindows l1'' l2' + l1 <- mapMaybe locationWindow <$> readNextLocationSet + withBorderColor selectedWindowsColor l1 $ do + liftFromX $ addStringToPendingBuffer " " + l2 <- mapMaybe locationWindow <$> readNextLocationSet + let (l1', l2') = + if length l1 > length l2 + then (l1, l2) + else (l2, l1) + l1'' = filter (not . (`elem` l2')) l1' + in liftFromX $ do + setAlternateWindows (l1'' ++ l2') + swapWindows l1'' l2' -- let doExec :: KeyFeed a -> KeyFeed a -> KeyFeed a -- doExec ifDouble notDouble = @@ -431,7 +432,7 @@ bindings = do runMaybeT_ $ do w1 <- runKeyFeed readNextWorkspaceName wins <- lift $ W.windowsOnWorkspace w1 <$> gets windowset - withBorderColorM selectedWindowsColor wins $ do + withBorderColor selectedWindowsColor wins $ do lift $ addStringToPendingBuffer " " w2 <- runKeyFeed readNextWorkspaceName lift $ windows $ W.swapWorkspaces w1 w2 @@ -834,7 +835,7 @@ bindings = do $ do stackset <- lift $ X.windowset <$> X.get selection <- mapMaybe locationWindow <$> runKeyFeed readNextLocationSet - (allMovements, finalSwap) <- withBorderColorM selectedWindowsColor selection $ do + (allMovements, finalSwap) <- withBorderColor selectedWindowsColor selection $ do lift $ addStringToPendingBuffer " " ws <- runKeyFeed readNextWorkspace finalSwap <- |