Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window resizing behavior broken in HEAD #643

Closed
Liquidmantis opened this issue Aug 22, 2020 · 2 comments
Closed

Window resizing behavior broken in HEAD #643

Liquidmantis opened this issue Aug 22, 2020 · 2 comments

Comments

@Liquidmantis
Copy link

I just updated to the latest HEAD and my vertical window resizing hotkeys are no longer working. I can still resize left and right fine, but top and bottom don't have any effect. If I run yabai in verbose mode, I can see the "cannot locate a bsp node fence" error if I resize by exterior edge, but if I resize by the interior edge there's no error and no effect.

Sorry, I don't know what commit I was on prior to this update, but I had updated from 3.2.1 to HEAD around two or three weeks ago and resizing was working.

@koekeishiya
Copy link
Owner

koekeishiya commented Sep 14, 2020

The various combination of window resizing seems to work fine for me, I am unable to reproduce the issue you described.
Could you post the bind you use? I'm not really sure what you mean by resize by exterior vs interior edge.

Assuming the following layout:

+---------+
| A  |  C |
|----|----|
| B  |  D |
+---------+

E.g:
# operations that work on window A

# move right border towards C (increase size of A)
yabai -m window --resize right:20:0
# move right border away from C (decrease size of A)
yabai -m window --resize right:-20:0

# move left border of A (there is no border, bsp fence message will be reported)
yabai -m window --resize left:20:0
# move left border of A (there is no border, bsp fence message will be reported)
yabai -m window --resize left:-20:0

# the same set of restrictions apply to window C (although mirrored).
# the same set of restrictions apply to the y-axis, although rotated.

@Liquidmantis
Copy link
Author

Liquidmantis commented Sep 14, 2020

@#%^!!! This was another case of PEBCAK. I looked at this again with fresh eyes and realized that after a refactor my top/bottom resizes were using the X segment, not the Y. Sorry for wasting your time.

For clarity, I was having issues with the A/B and C/D borders, what I was referring to as the "interior", or bsp fence. The non-touching "exterior" edge being the top edge of A or bottom edge of B, for example, and I'm using the OR catch in that case.

Here is my code, although I'm using Hammerspoon:
Helper function:

function yabaiMsg(scope, param, fallbackParam)
    local planA = string.format("%s -m %s --%s", yabaiPath, scope, param)
    local cmd = ''
    if fallbackParam==nil then
        cmd = planA
    else
        local planB = string.format("%s -m %s --%s", yabaiPath, scope, fallbackParam)
        cmd = string.format("%s || %s", planA, planB)
    end
    print(cmd)
    os.execute(cmd)
end

Fixed and functional code for resizes (hyperWindowResize is one of my "modes" in Hammerspoon:

-- Yabai window resizing targets an edge that is adjacent to other windows
-- Using the OR operator allows thinking in terms of the window division
-- and letting "error handling" conduct the logical operation regardless of
-- window focus and relative internal edge.
hyperWindowResize:bind('', 'h', function() yabaiMsg( 'window', 'resize right:-30:0', 'resize left:-30:0' ) end)
hyperWindowResize:bind('', 'l', function() yabaiMsg( 'window', 'resize right:30:0', 'resize left:30:0' ) end)
hyperWindowResize:bind('', 'j', function() yabaiMsg( 'window', 'resize top:0:30', 'resize bottom:0:30' ) end)
hyperWindowResize:bind('', 'k', function() yabaiMsg( 'window', 'resize top:0:-30', 'resize bottom:0:-30' ) end)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants