aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2020-04-22 11:34:55 -0600
committerJosh Rahm <rahm@google.com>2020-04-22 11:34:55 -0600
commitb5738a4792ea94f0f754aae4137d87ddc2a0f077 (patch)
tree4a39b20c432c8c3005c1c397ec32054f9ad8d339 /src
parent475a99a72e43a3ebd8c5761d67309f5ac9d90e6d (diff)
downloadrde-b5738a4792ea94f0f754aae4137d87ddc2a0f077.tar.gz
rde-b5738a4792ea94f0f754aae4137d87ddc2a0f077.tar.bz2
rde-b5738a4792ea94f0f754aae4137d87ddc2a0f077.zip
Change how clicking works. Allow click through on focus and change focus to current window when pressing the mouse macro buttons.
Diffstat (limited to 'src')
-rw-r--r--src/Internal/Keys.hs14
-rw-r--r--src/Main.hs1
2 files changed, 12 insertions, 3 deletions
diff --git a/src/Internal/Keys.hs b/src/Internal/Keys.hs
index 75a1de9..19ff5b5 100644
--- a/src/Internal/Keys.hs
+++ b/src/Internal/Keys.hs
@@ -1,6 +1,8 @@
{-# LANGUAGE RankNTypes #-}
module Internal.Keys where
+import System.Process
+import XMonad.Util.Ungrab
import Internal.XPlus
import Data.Maybe (isJust)
import Debug.Trace
@@ -54,6 +56,12 @@ newMouse markContext =
, ((modm, 9), const (relativeWorkspaceShift next))
]
+click :: X ()
+click = do
+ (dpy, root) <- asks $ (,) <$> display <*> theRoot
+ (_, _, window, _, _, _, _, _) <- io $ queryPointer dpy root
+ focus window
+
newKeys :: MarkContext -> IO (KeyMap l)
newKeys markContext =
return $ \config@(XConfig {modMask = modm}) ->
@@ -118,9 +126,9 @@ newKeys markContext =
, ((modm .|. mod1Mask, xK_e), runXPlus markContext config (withScreen W.greedyView 2))
-- Buttons programmed on my mouse.
- , ((shiftMask, xK_F1), withFocused $ windows . W.sink)
- , ((shiftMask, xK_F2), sendMessage ToggleZoom)
- , ((shiftMask, xK_F3), kill)
+ , ((shiftMask, xK_F1), click >> (withFocused $ windows . W.sink))
+ , ((shiftMask, xK_F2), click >> sendMessage ToggleZoom)
+ , ((shiftMask, xK_F3), click >> kill)
]
mapNumbersAndAlpha :: KeyMask -> (Char -> X ()) -> Map (KeyMask, KeySym) (X ())
diff --git a/src/Main.hs b/src/Main.hs
index 7522ebc..1d07ef8 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -44,6 +44,7 @@ main = do
, workspaces = map return (['0'..'9'] ++ ['a'..'z'])
, handleEventHook = fullscreenEventHook
, focusFollowsMouse = False
+ , clickJustFocuses = False
}
let toggleStructsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)