aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Dragging.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2023-12-06 18:03:11 -0700
committerJosh Rahm <rahm@google.com>2023-12-06 18:03:11 -0700
commit74cdda710ffa1f99d8251759a62e1bea9fc61ff5 (patch)
treea8aeb1bb9e6553263d6c9173c48f39f77856735e /src/Rahm/Desktop/Dragging.hs
parent8e2466e4b9a656622878d197e0d47161e6e10c4b (diff)
downloadrde-74cdda710ffa1f99d8251759a62e1bea9fc61ff5.tar.gz
rde-74cdda710ffa1f99d8251759a62e1bea9fc61ff5.tar.bz2
rde-74cdda710ffa1f99d8251759a62e1bea9fc61ff5.zip
Add new 'selected windows' feature
This new feature creates a 'selected windows' buffer which allows the user to select windows. These windows are then automatically made the argument for a Wml window operation such as shifting. This is great for when one wants to apply an action to a set of windows which are too difficult to describe with Wml expressions. In addition, I have added a bunch of mouse bindings and key bindings to this.
Diffstat (limited to 'src/Rahm/Desktop/Dragging.hs')
-rw-r--r--src/Rahm/Desktop/Dragging.hs19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/Rahm/Desktop/Dragging.hs b/src/Rahm/Desktop/Dragging.hs
index 8485a46..5252390 100644
--- a/src/Rahm/Desktop/Dragging.hs
+++ b/src/Rahm/Desktop/Dragging.hs
@@ -5,7 +5,7 @@ import Control.Monad.Trans (lift)
import Control.Monad.Trans.Maybe (MaybeT (MaybeT))
import Data.IORef (newIORef, readIORef, writeIORef)
import Data.Maybe (fromMaybe)
-import Rahm.Desktop.Common (runMaybeT_, setBorderColor)
+import Rahm.Desktop.Common (runMaybeT_, setBorderColor, pointerWindow, pointerLocation)
import Rahm.Desktop.Layout.Hole (addHoleForWindow, removeHoleForWindow, resetHole)
import Rahm.Desktop.Logger
import Rahm.Desktop.Marking (setAlternateWindows)
@@ -97,23 +97,6 @@ mouseMoveWindowAndThen beforeAction (AfterDragAction releaseAction) window = do
releaseAction window (maybe 0 X.ev_button curev)
X.refresh
-getDisplayAndRoot :: X (X.Display, X.Window)
-getDisplayAndRoot = X.asks $ (,) <$> X.display <*> X.theRoot
-
-pointerLocation :: (Integral a, Integral b) => X (a, b)
-pointerLocation = do
- (dpy, root) <- getDisplayAndRoot
- (_, _, _, fromIntegral -> x, fromIntegral -> y, _, _, _) <-
- io $ X.queryPointer dpy root
- return (x, y)
-
-pointerWindow :: X X.Window
-pointerWindow = do
- (dpy, root) <- getDisplayAndRoot
- (_, _, w, _, _, _, _, _) <-
- io $ X.queryPointer dpy root
- return w
-
dragWorkspace :: X ()
dragWorkspace = do
(ox, oy) <- pointerLocation