aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2024-10-14 11:38:15 -0600
committerJosh Rahm <rahm@google.com>2024-10-14 11:38:44 -0600
commit9b0750ba68aee61aacf7538b5b14d8f265e934e5 (patch)
tree19b9bc2b2421d4ab94f28f1e8089b3d568fc2315 /src/Rahm/Desktop/Keys
parent08eacc1d437b08863ebe521446e040bc4fa219a2 (diff)
downloadrde-9b0750ba68aee61aacf7538b5b14d8f265e934e5.tar.gz
rde-9b0750ba68aee61aacf7538b5b14d8f265e934e5.tar.bz2
rde-9b0750ba68aee61aacf7538b5b14d8f265e934e5.zip
Add some support for vertially ordered screens.
Add's the workspace '+' as the first workspace that's not on the same 'plane' as the current workspace. A screen, screen1 is considered on the same plane as screen2 if screen2's vertical center point is within screen1's vertical bounds.
Diffstat (limited to 'src/Rahm/Desktop/Keys')
-rw-r--r--src/Rahm/Desktop/Keys/Wml.hs21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/Rahm/Desktop/Keys/Wml.hs b/src/Rahm/Desktop/Keys/Wml.hs
index 0c09fd1..792ff74 100644
--- a/src/Rahm/Desktop/Keys/Wml.hs
+++ b/src/Rahm/Desktop/Keys/Wml.hs
@@ -93,7 +93,7 @@ import Rahm.Desktop.History
)
import Rahm.Desktop.Keys.KeyFeed
import Rahm.Desktop.Layout.PinWindow (pinnedWindows)
-import Rahm.Desktop.Logger (LogLevel (Info, Trace), logs)
+import Rahm.Desktop.Logger
import Rahm.Desktop.Marking
( farLeftWindow,
farRightWindow,
@@ -105,14 +105,6 @@ import Rahm.Desktop.Marking
import qualified Rahm.Desktop.StackSet as W
import Rahm.Desktop.Submap (mapNextStringWithKeysym)
import Rahm.Desktop.Workspaces
- ( accompaningWorkspace,
- adjacentWorkspace,
- adjacentWorkspaceNotVisible,
- getHorizontallyOrderedScreens,
- next,
- prev,
- workspaceWithWindow,
- )
import Rahm.Desktop.XMobarLog.PendingBuffer
( addStringToPendingBuffer,
setPendingBuffer,
@@ -474,12 +466,21 @@ readNextWorkspace =
screens <-
liftXToFeed $
map (W.tag . W.workspace . snd)
- <$> withWindowSet (return . getHorizontallyOrderedScreens)
+ <$> withWindowSet (return . getScreensOnSamePlane)
let (_, rest) = break ((== workspaceName ws) . Just) (screens ++ screens)
justWorkspace <$> hoistMaybe (head $ tail rest)
+ -- Workspace on the screen above the current workspace..
+ (_, _, "+") -> do
+ screens <-
+ liftXToFeed $
+ map (W.tag . W.workspace . snd)
+ <$> withWindowSet (return . getScreensOnDifferentPlane)
+
+ justWorkspace <$> hoistMaybe (head screens)
+
-- Workspace to the next screen to the left of the next workspace.
(_, _, ";") -> do
ws <- readNextWorkspace