Commit graph

15 commits

Author SHA1 Message Date
Vlad Zahorodnii
6d3f00e82c autotests: Remove QVERIFY(signalSpy.isValid())
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.
2022-09-14 09:21:29 +00:00
Xaver Hugl
8955a2420e replace all uses of QScopedPointer with std::unique_ptr 2022-08-04 12:30:09 +00:00
Weng Xuetian
18763d1483 Fix flaky testTextInputV3Interface
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.
2022-06-23 14:44:42 +00:00
Weng Xuetian
a74c436156 Always send a done after commit for text input v3.
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.
2022-06-11 20:24:35 +00:00
Vlad Zahorodnii
b64f95b703 Integrate kwaylandserver
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.
2022-04-22 12:27:33 +03:00
Volker Krause
ccad0066e7 Disambiguate KWaylandServer::Display
This unfortunately clashes with a typedef in a Qt6 header.
2022-03-18 14:34:41 +00:00
Weng Xuetian
afc2a1c0aa Clean up the focus handling for text input.
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.
2021-12-29 00:38:48 +00:00
Alexander Lohnau
525d12bee5 Run clang-format
If you want git blame to ignore formatting revisions run:
git config blame.ignoreRevsFile .git-blame-ignore-revs
2021-08-29 07:11:06 +02:00
Laurent Montel
0c49d302ce Use Q_EMIT to make it compile against kf5.82 2021-05-13 11:33:08 +02:00
Vlad Zahorodnii
1d7bc7128d Port SeatInterface to the new approach
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.
2021-03-10 22:18:59 +02:00
Vlad Zahorodnii
09e079b78f Remove factory methods in Display
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.
2020-12-14 13:04:59 +00:00
Vlad Zahorodnii
1247a53eba Allow accepting client connections on multiple sockets
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.
2020-12-09 07:20:42 +00:00
Bhushan Shah
30a5cc766c text-input-v3: track commit counts per resource
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
2020-10-07 11:38:46 +05:30
Vlad Zahorodnii
9707e7c443 Hopefully fix build on FreeBSD 2020-09-29 14:11:32 +03:00
Bhushan Shah
48535b8bc1 server: implement the text-input-unstable-v3
This commit implements the zwp_text_input_v3 in kwayland-server, part of
code is inspired based on the initial patch from Roman at D16735.
2020-09-29 16:16:28 +05:30