Snap floating windows on drop

master
Hektor Misplon 2023-12-30 12:40:00 +01:00
parent 5e5c5464d3
commit 2e29cb8292
Signed by: hektor
GPG Key ID: 5151AF79E723F21C
1 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,7 @@
import XMonad import XMonad
import XMonad.Actions.CopyWindow (copyToAll, killAllOtherCopies) import XMonad.Actions.CopyWindow (copyToAll, killAllOtherCopies)
import XMonad.Actions.FloatSnap
import XMonad.Hooks.DynamicProperty import XMonad.Hooks.DynamicProperty
import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks import XMonad.Hooks.ManageDocks
@ -215,7 +216,12 @@ zipKeyPrefixes prefixes keys = [prefix ++ key | prefix <- prefixes, key <- keys]
myRemoveKeys :: [String] myRemoveKeys :: [String]
myRemoveKeys = "M-S-q" : zipKeyPrefixes ["M-", "M-S-"] (map show [ 1..5 ]) myRemoveKeys = "M-S-q" : zipKeyPrefixes ["M-", "M-S-"] (map show [ 1..5 ])
myMouseBindings = [] myMouseBindings =
[
((mod4Mask, button1), (\w -> focus w >> mouseMoveWindow w >> afterDrag (snapMagicMove (Just 50) (Just 50) w)))
, ((mod4Mask .|. shiftMask, button1), (\w -> focus w >> mouseMoveWindow w >> afterDrag (snapMagicResize [L,R,U,D] (Just 50) (Just 50) w)))
, ((mod4Mask, button3), (\w -> focus w >> mouseResizeWindow w >> afterDrag (snapMagicResize [R,D] (Just 50) (Just 50) w)))
]
unfloatFocusedW :: X () unfloatFocusedW :: X ()
unfloatFocusedW = withFocused $ windows . W.sink unfloatFocusedW = withFocused $ windows . W.sink