We use the PMF syntax so the isValid() check is unnecessary as the
compiler will notify about wrong signal at compile time. It makes
writing autotests feel less boilerplaty.
In a74c436156, we changed behavior that
every commit() will be followed by a done(), which makes this test might
catch a different done() from server. Change the spy to make sure it
exhaust all other done before checking the one expected.
In Gtk's text-input-v3 implementation it expect done to update the
client serial after every commit. Though it is unclear whether this is a
protocol requirements, do the same thing like mutter for more
compatiblity, especially Gtk3 is in EOL not likely to be patched any
time soon.
To do so, we will need to keep track of the last active preedit,
otherwise only send_done() will clear the preedit.
This makes KWin switch to in-tree copy of KWaylandServer codebase.
KWaylandServer namespace has been left as is. It will be addressed later
by renaming classes in order to fit in the KWin namespace.
Usually, a client will only use text input v2/v3. Do not return the focused
surface for text input if it has no relevant text input resource.
If text-input object is created after surface get the focus, send
enter to this text input object. Ensure sendEnter and sendLeave always
appear in pair.
Also, use the same technique in text-input-v2 for text-input-v3 to
handle per resource's enable/disable state, and only send update to
enabled text-input-v3 object.
This rewrites the wl_seat protocol implementation to adhere to the new
design principles.
Effectively, we've been supporting wl_seat v7 so the version was also
bumped from 5 to 7.
The main reason why we have factory methods is that up to some point,
kwayland had its own signal to indicate when globals have to be removed.
Now that all globals add destroy listeners for the wl_display object,
we don't have that signal. Most factory methods are equivalent to doing
new T(display).
Besides adding unnecessary boilerplate code, another reason to get rid
of the factory methods is to reduce the amount of merge conflicts. If
several persons work on implementing wayland protocols at the same time,
sooner or later someone will have to resolve merge conflicts in Display.
libwayland-server allows the wl_display accept client connections on
more than one socket. We currently don't listen on multiple sockets,
but it would be nice if Display supported such operation mode.
If we track the commit counts at compositor global, this will fail
horribly for anything other than the first text-input-v3 client, as for
new client the serial count will not be what it expects in the done()
request and it will simply consider events as outdated and will refuse
to accept those events