X11: A regular intermediate window is created before the actual prefs dialog.
This cause trouble - it's inserted shortly into the tiling.
Wayland: The prefs dialog is opened as a regular window
We'd like the prefs dialog (at least our own) to float.
Specifically fixes bug where whole scratch layer become visible (but only the
actors) when reloading (or disable/enable cycle) when at least on scratch window
was active.
This also sometimes crashed gnome-shell (confirmed on v3.28.3 - ubuntu 18.04)
Also remove some code who seem to partly work around the problem
When window_gap is largish it was possible to click on the non-placable
metawindow (between the stackoverlay and the neigbour window) - triggering #80.
L: left non-placable (clone)
R: right non-placable (clone)
G: gap/2
A/B: placable window
LGGAA..BBBGGR
Allocate `LGG - "guaranteed-resize-edge-width"` to the stackoverlay to ensure
it's impossible to click on the non-placable window below.
Ideally we'd only allocate L or maybe LG to the overlay. Note: We could add
special logic for wayland since #80 only affects X11.
We need to raise one of the focused window neighbours preemptively to get sane
focus after closing a window (ie. one of the neighbours should always get
focus).
However we also use the windows' stacking order to decide eg. which window in
a vertical tiling to select when entering from the side. Raising the neighbours
on focus can easily break this behavior, as the top window no longer is the most
recently selected.
If we use the clones stacking order instead we avoid these issues as it's
unaffected by the unavoidable window raising we do on focus.
When a new window is created from the overview [1], `display.focus_window` is
null. This broke our "should-window-be-scratch" logic.
Behavior observed both on X11 and wayland
[1] or the 'switcher' extension. Probably in general if a shell modal is active
when the window is created?
This covers scratch windows too.
Note: Specifically fixes a bug where 'tilix --quake' didn't work. tilix creates
a "on all workspaces windows" that was hidden in showHandler and never shown
again
Introduces `Space.addFloating` and `Space.removeFloating`. `startAnimate` and
`moveDone` takes care of showing the clone, syncing its position and hiding it.
This makes floating windows follow the workspace in the workspace carousel,
removing the rather ugly hack in `spaces.switchWorkspace` and simplifying
`showHandler`.
This makes selection logic a lot more centralized and robust. In particular the
selection highlight will now consitently track the window clone.
Also introduce `showWindow` `animateWindow` and `isWindowAnimating` to wrap some
potentially changing structure.
This fixes (mostly) issues with layout of constrained wayland windows.
eg. (* marks the selected window) slurp B:
layout
column A* B
...
resize of constrained window B finishes (before A)
trigger new layout (since target was not met)
`allocateDefault` strive to keep A's height (yet to be changed)
causing A to get all the height
We still have problems when the slurping the last window X (while X selected)
into a column with two constrained windows.