Commit graph

29 commits

Author SHA1 Message Date
Aleix Pol
a94f5c0d7f wayland/autotests: Make sure SeatInterface gets deleted 2022-07-28 07:23:56 +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
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
Vlad Zahorodnii
a50f84a868 Merge notifyPointerPress() and notifyPointerRelease()
This brings the API of the SeatInterface class and the PointerInterface
class closer the corresponding Wayland API.
2021-03-23 11:20:03 +02:00
Vlad Zahorodnii
4e16b10e82 Rename some SeatInterface methods following consistent naming scheme
This change renames methods that are used by the compositor to notify the
seat about input events.

There isn't anything special about the proposed naming scheme, for what
it is worth, it was established in weston. "notify" methods are used to
notify kwaylandserver about something, and "send" methods actually send
relevant events to wayland clients.
2021-03-12 10:19:03 +00: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
178c5d0595 Rewrite wl_pointer implementation with new approach
With this design, a single PointerInterface manages multiple wl_pointer
objects. This makes the API tidier and allows implementing things such as
keyboard grabs more easier.

In addition to that, the PointerInterface doesn't inject its own frame
events anymore. It's up to the compositor to decide when it has to be
sent. However, the PointerInterface may still send a frame event if the
pointer focus changes.

Besides re-writing the pointer interface, this change, unfortunately,
also affects the implementation of pointer-gestures and relative-pointer
protocols because previously they were coupled to individual instances
of PointerInterface.
2021-03-10 14:05:20 +00: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
bfc174ea58 keyboard_interface: remove wrapper methods from the seat_interface
And make them public in th keyboard_interface, there's no point in
wrapping this in seat_interface with new approach

See also: plasma/kwayland-server#13
2020-11-19 06:05:06 +00:00
Vlad Zahorodnii
34982850e2 Destroy all clients before destroying wl_display
One of the most disappointing things when writing autotests is dealing
with a race condition where destructor requests are processed after all
globals have been destroyed.

With this change, the Display object will destroy all clients and their
resources before destroying the wl_display object. The good thing about
doing so is that shut down logic becomes simple. We don't have to assume
that wl_resource objects can outlive their wl_global objects, etc. The
bad thing is that it exposed a couple of pre-existing latent bugs in the
data device and the xdg foreign code.

closes plasma/kwayland-server#2
2020-11-11 09:26:57 +02:00
Adrien Faveraux
68e0604ad7 move keyboard to the new approach and refactor the keyboard_interface
- Get rid of the KF5 deprecated methods related to keymap,
  kwayland-server is not source compatible with kwayland, so we don't
  need to keep the deprecated methods
- Move the key repeat, modifiers and keymap handling fully into the
  KeyboardInterface.
- Get rid of some of the keyboard related code base from the
  seat_interface.

Co-Author: Bhushan Shah <bshah@kde.org>
2020-10-20 20:09:51 +05:30
Vlad Zahorodnii
a634ce77c1 Allow creating global objects before Display is started
It can be especially useful if the compositor wants to ensure that all
globals have been created before starting to accept client connections.

Unfortunately, start() and terminate() stuff doesn't align well with it,
so the terminate() method was dropped to ensure that Display always
returns the same wl_display object.
2020-07-08 07:25:23 +00:00
Aleix Pol
306f242ac8 Port namespaces and includes 2020-04-29 16:56:38 +02:00
Andreas Cord-Landwehr
9267f146fd KWayland: Convert license headers to SPDX
Summary:
Convert license headers to SPDX expressions and add license files as
required by REUSE specification.

Reviewers: zzag

Reviewed By: zzag

Subscribers: kde-frameworks-devel

Tags: #frameworks

Maniphest Tasks: T11550

Differential Revision: https://phabricator.kde.org/D28058
2020-03-16 19:57:44 +01:00
Laurent Montel
6f45c74471 Remove qt include prefixx 2018-11-06 07:22:36 +01:00
Martin Gräßlin
042896a755 [server] Add Display::seats() -> QVector<SeatInterface*>
Similar to OutputInterfaces we can have multiple SeatInterfaces so
expose a way to get to all SeatInterfaces.

REVIEW: 126364
2015-12-15 15:49:12 +01:00
Martin Gräßlin
13bf4c9484 Implement repeat info on wl_keyboard protocol
* Raises wl_seat supported version to 4 in both server and client
* Raises wl_keyboard supported version to 4 in wl_keyboard
* wl_pointer and wl_touch are still on version 3
* Raises minimum Wayland version to 1.6
2015-09-02 16:04:14 +02:00
Martin Gräßlin
d425515a99 Move pointer button handling from PointerInterface to SeatInterface
The button state is a seat-global state and not a per pointer state.
All pressed/released and axis events are moved to the SeatInterface
and just invoke the related method on the focused surface pointer.
2014-11-26 11:50:52 +01:00
Martin Gräßlin
ef1a0a0e64 Create one PointerInterface for each pointer wl_resource
Makes PointerInterface more like other Interface classes wrapping
wl_resource. The most important change is the handling of the
focused surface. This is now kept in the SeatInterface and can also
be set if there is no PointerInterface for the client yet.

The unit tests had to be adjusted and some are also disabled as the
button events are not yet moved into SeatInterface.
2014-11-26 10:34:23 +01:00
Martin Gräßlin
961aaae8f1 [server] Add a SeatInterface::focusedPointer
This method is supposed to return the PointerInterface for the current
focused surface. At the moment it just creates the one global
PointerInterface. The existing SeatInterface::pointer method got
removed as that is actually wrong usage.
2014-11-25 16:04:07 +01:00
Martin Gräßlin
12477a66fc [server] Move pointer position from PointerInterface to SeatInterface
PointerInterface should only wrap a Resource. In order to do so all
global state needs to move into the Global.
2014-11-25 14:24:52 +01:00
Martin Gräßlin
e6b91f5628 [server] Move PointerInterface into own .h and .cpp 2014-11-25 13:53:16 +01:00
Martin Gräßlin
eb9e5a178f Switch all auto tests to QTEST_GUILESS_MAIN
We don't need a QGuiApplication in the tests.
2014-09-23 12:00:17 +02:00
Martin Gräßlin
a8c7c16c94 Use namespace KWayland::Server instead of KWin::WaylandServer
It's no longer part of KWin.
2014-09-17 16:10:38 +02:00
Martin Gräßlin
3c87cea7a8 Change to LGPLv2+
I'm the only copyright holder of the code in this repository, thus
I can change from GPL to LGPL!
2014-09-17 15:57:56 +02:00
Martin Gräßlin
e763d9acc0 Add a build system
Framework style build system which generates two libraries:
* KF5WaylandClient
* KF5WaylandServer

autotests are adjusted to compile again. They need to be changed to
use the libraries once the export header gets generated.
2014-09-17 14:35:33 +02:00
Martin Gräßlin
bc93c5c6a8 Move all files to autotests/server 2014-09-17 13:24:51 +02:00
Renamed from src/wayland/test_seat.cpp (Browse further)