InputRedirection connects to lockStateChanged to udate the current
pointer window. This way we can ensure that the current pointer
surface gets reset as soon as the screen locks (c.f. the expect
fail in the autotest) and also that it restores to the surface under
the mouse once the screen is unlocked.
The relevant code was not yet lock screen aware and performed an
early exit. Part of the code was fine, e.g. findToplevel is lock
screen aware. So this change adjusts the methods for updating the
internal window and decoration to be lock screen aware, that is they
get reset. With that updatePointerWindow is also lock screen aware.
Thus the LockScreenFilter can also use updatePointerWindow just like
the normal handling and does not need to reimplement parts of it. As
it now relies on other code being correct it has an additional check
to verify that the current pointer surface is a surface which is allowed
to get events. If it isn't the events are not forwarded.
Reviewed-By: Bhushan Shah
Interesting approach I would not have expected to work. A dummy Effect
class is created in the test and an instance is passed to
EffectsHandler's startMouseInterception. It doesn't verify whether it's
an Effect it knows or has created, so it's totally happy with the dummy.
It shows that motion and press/release are passed to the Effect when
screen is not locked and doesn't while the screen is locked.
On the CI system our tests failed due to the greeter failing to start
due to OpenGL problems. This was because we waited for a window to show
which never happened. Thus the test failed.
This change makes use of the new lockStateChanged signal to determine
when the screen gets locked/unlocked.
It's still possible that the test fails as I'm not able to reproduce
the failure condition on the CI system.
First test case is to ensure that pointer motion events trigger a
leave event on the surface the pointer is on.
The test case shows errors in the input handling.
More tests need to be added.