Regression: enable() is run too early to find the topbar the way we did it
before. Commented out the statusbar.visible handling, and hardcoded the height
for now.
TODO: find a signal we can use to find the topbar properly.
When there's enough screen width to fit all windows, make them share the
available space evenly.
NOTES:
This does NOT set the currently ensuring window, and does an ugly early return.
To reproduce:
- activate the popup
- move the pointer over an entry
- use the keyboard to select another entry
On modifier release the keyboard-selected window get focus, but the mouse/pointer
hovered window is ensured.
Not sure why item-enter (hover) is triggered since the pointer already has
entered that item, but this is a workaround. Even if the pointer was required to
move the situation could probably be triggered by actually moving the pointer
while releasing the modifier key.
This should in principle start the animation when the obscuring window have
moved margin - margin_lr frames, which is in the ballbark of what we want.
Had to divide the whole thing by two, not sure why that should've been necessary.
It might be better to use easeOutQuad though, since the other windows are
already moving.
This make scaling and positioning windows with different buffer/frame deltas
consistent, and is what we actually want. ie. the height we're interested
setting is the height of the visible window (not the air around it).
When going to a scaled window set a tiny delay so the window to the left/right
have time to move out of the way before we `raise` and start the animation. The
animation time is reduced by the delay, so the animations should still finish at
the same time.
This isn't completely robust because it depends on the speed of window to the
left/right moves, which is determine by the width of the window we're ensuring.
This requires controlling the upper left/right most corner depending on which
side the window is stacked, ie. pivot points (0,0) and (1,0) respectively.
TODO: center fullscreen windows properly too
Notes:
- X11 ids isn't exposed(?) (MetaWindow.get_xwindow C only)
- No other stable id seems to be exposed (get_stable_sequence is not that
stable)
- Window title is too volatile (must persist order very frequently if used)
- Using the x position and stacking order seems to work (expect for windows that
take up 100% of the screen width)
Only position the new inactive window correctly, we should never move the
focused window without also moving focus, or some explicit move/resize action.