X.L.ResizableThreeColumns: Fix bottom right window not resizing

...by introducing yet another special case.  Unsurprisingly, this is
just a bandaid—the logic in this module is just wrong.  It
purposefully (not introduced with this change) computes the wrong
positions for certain extreme points such that splitVertically (which
simply goes down the list of stack windows _in order_) still works.

What we should do instead is to either

  - keep track of windows that want to change their size and compute a
    rectangle for them first, or

  - immediately when handling the resize message, compute *all* of the
    new sizes immediately (instead of only for the window getting
    resized).

The latter would force us to keep track of the size of the current stack
we operate in, but since 'handleMessage' lives in X this should not pose
a big problem.  I reckon this is the better approach.

Fixes: https://github.com/xmonad/xmonad-contrib/issues/788
This commit is contained in:
Tony Zorman 2022-12-31 12:58:28 +01:00
parent e0be851074
commit f7e9c0cf0d

View File

@ -99,8 +99,13 @@ instance LayoutClass ResizableThreeCol a where
mresize s MirrorExpand = mresize' s (negate delta) mresize s MirrorExpand = mresize' s (negate delta)
mresize' s delt = mresize' s delt =
let up = length $ W.up s let up = length $ W.up s
total = up + length (W.down s) + 1 down = length $ W.down s
pos = if up == (nmaster-1) || up == (total-1) then up-1 else up total = up + down + 1
pos = if up == nmaster - 1 -- upper right
|| up == total - 1 -- upper left
|| up `elem` [down, down + 1] -- lower right
then up - 1
else up
mfrac' = modifymfrac (mfrac ++ repeat 1) delt pos mfrac' = modifymfrac (mfrac ++ repeat 1) delt pos
in l { threeColSlaves = take total mfrac'} in l { threeColSlaves = take total mfrac'}
modifymfrac [] _ _ = [] modifymfrac [] _ _ = []