mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-06 06:51:55 -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:
@@ -47,6 +47,11 @@
|
|||||||
|
|
||||||
The `hoogle` function now uses the new URL `hoogle.haskell.org`.
|
The `hoogle` function now uses the new URL `hoogle.haskell.org`.
|
||||||
|
|
||||||
|
* `XMonad.Layout.MouseResizableTile`
|
||||||
|
|
||||||
|
When we calculate dragger widths, we first try to get the border width of
|
||||||
|
the focused window, before failing over to using the initial `borderWidth`.
|
||||||
|
|
||||||
## 0.16
|
## 0.16
|
||||||
|
|
||||||
### Breaking Changes
|
### Breaking Changes
|
||||||
|
@@ -36,6 +36,7 @@ module XMonad.Layout.MouseResizableTile (
|
|||||||
import XMonad hiding (tile, splitVertically, splitHorizontallyBy)
|
import XMonad hiding (tile, splitVertically, splitHorizontallyBy)
|
||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
import XMonad.Util.XUtils
|
import XMonad.Util.XUtils
|
||||||
|
import Graphics.X11 as X
|
||||||
|
|
||||||
-- $usage
|
-- $usage
|
||||||
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
|
-- 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) =
|
draggerGeometry (FixedDragger g d) =
|
||||||
return (fromIntegral $ g `div` 2, g, fromIntegral $ d `div` 2, d)
|
return (fromIntegral $ g `div` 2, g, fromIntegral $ d `div` 2, d)
|
||||||
draggerGeometry BordersDragger = do
|
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)
|
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 :: Bool -> DraggerWithRect -> DraggerWithRect
|
||||||
adjustForMirror False dragger = dragger
|
adjustForMirror False dragger = dragger
|
||||||
adjustForMirror True (draggerRect, draggerCursor, draggerInfo) =
|
adjustForMirror True (draggerRect, draggerCursor, draggerInfo) =
|
||||||
|
Reference in New Issue
Block a user