There's a few differences in how onComplete is run:
- We need to run moveDone on every clone transition, as the transitions aren't
done when cloneContainer's transition finishes
- We cannot run layout until startup is done. For some reason onComplete runs
before monitor setup is done properly.
squash! Use clutter animations
- Can't use addTween as a timeout, but transitions are now finished when
onComplete is run, so there's no need for this anymore.
In general: NPE in stackoverlay when target window is non-`TabList.NORMAL`
crashes `insertWindow` midway. (eg. size-changed signal never connected).
A `TabList.NORMAL` window is focusable and doesn't `mw.skip_taskbar`.
Example: The main window of pycharm on startup is (sometimes) non-normal(!).
Focusing the window fail so it's likely to become the stackoverlay target.
(java applications is a WM's worst nightmare..)
On multi monitor setups we usually want the monitor focus to follow the mouse
pointer since non-active workspaces don't react to the pointer at all.
Unfortunately it's not possible to warp the pointer from gnome-shell extensions
in wayland yet. The pointer will be left on an inactive monitor when switching
workspaces using the keyboard. This makes it extremely easy to trigger an motion
event and inadvertently switching monitor focus (in fact this simply happens the
moment we activate the motion listener).
So add a motion threshold to filter out pointer motions without user intent.
This fixes a rather annoying bug where we're not able to interact with windows
floating above the edge overlays. (doesn't work on X11 I think).
It also makes the interaction with a fixed dock on the edges better.
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.
Interacting with a shared monitor edge could be pretty jarring as it was very
easy to trigger a workspace change.
We add some (10px) negative padding to decrease the problem.
Ideally we wouldn't change window focus at all when moving the pointer to
another monitor. Unfortunately windows on a unactive workspace doesn't react to
pointer input (eg. scroll).
When the activate window is «stuck» we can preserve focus however. Otherwise we
select the top window on the newly active monitor.
An alternative would be to wait for button events to change workspace. This
could work okay, but the pointer wouldn't react to eg. window edges.
squash! workspace overlay: use motion-event
The motion-event is better suited to making sure the pointer is always able to
interact with the windows on a monitor.
Activating another workspace when moving scratch windows across monitors will
now cause issues. For instance moving a scratch window to another monitor with
they keyboard would reset focus back to the original monitor. So we simply let
the motion-event always take care of this.
We only need to calculate visible windows when we're ready to show window
actors again. This makes the tracking more robust as it should always be called
at the correct time.
`fixVisible` is replaced by `space.isPlaceable(metaWindow)` which checks if the
window actor can be placed at its clone's position. We simply call isPlaceable
from the main `moveDone` loop.
The cloneContainer now lives inside a `cloneClip` clipping the cloneContainer
correctly when previewing workspaces.
`ensureViewport` and `move_to` simply moves the scrollContainer instead of
laying out all the clones. The actual windows are only synced up with the clones
position on `Space.moveDone`. Space.layout is run when the actualy clone layout
changes, eg. when a window changes size, or a window is added to the tiling.
`move_to` also computes the windows that should show their MetaWindowActor on
`moveDone` and sets up the clickoverlays at the edges correctly.
`space.cloneContainer`s animation target can be looked at `space.targetX`.
Instead of removing the gap when we're dealing with fullscreen or maximized
windows we remove it when the overlay is wider than 75 pixels.
Also fully cover all windows that aren't marked as `visible` by the space.
We only replace windows with clones when their position isn't possible, ie. when
they're less than 75 pixels inside the space, they're maximized or fullescreen.
The clickoverlays is now mostly decoupled from the visible status of the window
actor. They now always target the first window with an edge outside the
monitor. The width however is limited to 75 pixels (unless the window isn't
visible) making eg. drag and drop and drop possible while edge clicking will
never send input to the window.
The clickoverlays will now also span the window gap which makes it possible to
click on windows that's just off the monitor.
We're assessing all top level declarations from outside the original scope when
we're evaluating code. So everything should be `var`.
Classes are `let` bound so we should use var for `ClickOverlay` too, but there's
a bug in gnome-shell-mode making such statements not evaluate. We therefor wait
for that to be fixed.