mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 04:01:51 -07:00
X.L.MouseResizableTile borderWidth via focused win
When we calculate draggerGeometry, we should use the current width of the border (if available), rather than the initial borderWidth.
This commit is contained in:
@@ -36,6 +36,7 @@ module XMonad.Layout.MouseResizableTile (
|
||||
import XMonad hiding (tile, splitVertically, splitHorizontallyBy)
|
||||
import qualified XMonad.StackSet as W
|
||||
import XMonad.Util.XUtils
|
||||
import Graphics.X11 as X
|
||||
|
||||
-- $usage
|
||||
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
|
||||
@@ -189,9 +190,18 @@ draggerGeometry :: DraggerType -> X DraggerGeometry
|
||||
draggerGeometry (FixedDragger g d) =
|
||||
return (fromIntegral $ g `div` 2, g, fromIntegral $ d `div` 2, d)
|
||||
draggerGeometry BordersDragger = do
|
||||
w <- asks (borderWidth . config)
|
||||
wins <- gets windowset
|
||||
w <- case W.peek wins of
|
||||
Just win -> getBorderWidth win
|
||||
_ -> asks (borderWidth . config)
|
||||
return (0, 0, fromIntegral w, 2*w)
|
||||
|
||||
getBorderWidth :: Window -> X Dimension
|
||||
getBorderWidth win = do
|
||||
d <- asks display
|
||||
(_,_,_,_,_,w,_) <- io $ X.getGeometry d win
|
||||
return w
|
||||
|
||||
adjustForMirror :: Bool -> DraggerWithRect -> DraggerWithRect
|
||||
adjustForMirror False dragger = dragger
|
||||
adjustForMirror True (draggerRect, draggerCursor, draggerInfo) =
|
||||
|
Reference in New Issue
Block a user