Commit graph

29 commits

Author SHA1 Message Date
Vlad Zahorodnii
7d56aa3687 Merge wayland tests with other tests
This makes wayland tests organization consistent with other kwin tests.
2023-10-06 11:21:00 +00:00
Vlad Zahorodnii
de36fe82e8 wayland: Integrate KWaylandServer classes into KWin namespace 2023-09-15 16:31:15 +03:00
Vlad Zahorodnii
8bf2318800 wayland: Drop "_interface" from filenames
The cpp files in the wayland directory are named after protocol names.
"_interface" does not contribute anything new.
2023-09-15 13:13:43 +00:00
Vlad Zahorodnii
a51277f88a wayland: Remove QPointer from public SurfaceInterface api
QPointer is not meant for return values. There are also performance
considerations to avoid returning QPointer.
2023-09-07 14:14:40 +03:00
Laurent Montel
86c6238cfa Don't use QtTest => use QTest + missing include 2023-07-04 10:38:21 +00:00
Vlad Zahorodnii
9f345d4dd3 autotests: Fix remaining "using namespace KWayland::Client" 2022-11-08 23:15:17 +02:00
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
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
Vlad Zahorodnii
227ab071be Run .clang-format 2022-04-19 13:14:26 +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
16db81b5cc Make RegionInterface private
If a Wayland protocol deals with regions, they will be exposed as
QRegion objects in public API. Therefore, it makes sense to make
RegionInterface private as it's an implementation detail and it's
not intended to be used in public api.

The corresponding test was dropped because the CompositorInterface
no longer emits a signal to indicate that a wl_region has been created.
It should be also noted that wl_region stuff is already tested via
other means, e.g. surface damage, etc.
2021-03-15 16:28:30 +00:00
David Edmundson
09a45da505 Port all connects
This is mostly all automatic from clazy, though it got confused by a few
namespace issues.
2021-02-25 13:48:11 +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
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
Vlad Zahorodnii
33f4254bd1 Port the wl_compositor wrapper to the new approach 2020-07-15 11:05:59 +03:00
Adrien Faveraux
095edbed4c migrate Contrast to new approach 2020-07-14 18:24:24 +00:00
Aleix Pol
306f242ac8 Port namespaces and includes 2020-04-29 16:56:38 +02:00
Aleix Pol
5d4cd7dcd3 Fix build 2020-04-29 15:59:23 +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
Marco Martin
cd77833c3b add .data() to qpointer access
fix build on old gcc versions
2016-06-30 16:45:29 +02:00
Martin Gräßlin
5232dc5f0f [server] Don't destroy ContrastInterface when parent SurfaceInterface is destroyed
Summary:
Destroying the ContrastInterface on the server side before the client has
a chance to cleanup results in a protocol error:
wl_display@1: error 0: invalid object 7

Which would terminate the client. If we would not destroy the resource,
but only delete the ContrastInterface it could result in
heap-use-after-free.

So just don't do anything, the client needs to cleanup which will result
in the ContrastInterface being deleted.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1709
2016-06-01 07:32:03 +02:00
Martin Gräßlin
b0b5e16667 [autotest] Prepare TestContrast for multiple test cases
Registry was not per test case, cleanup didn't clean up everything,
etc. Basically adding a second test case resulted in a crash.
2016-05-30 10:03:19 +02:00
Martin Gräßlin
ab98448fec [server] Standardize the destructor request handling for Resources
Summary:
This change standardizes the behavior regarding the destructor request.

The destructor should destroy the resource and nothing else. The
Wayland library invokes the static unbind method once the resource is
destroyed. The implementation provided by Resource::Private::unbind
triggers a delete later on the Resource. So there is no need to trigger
a deleteLater from the destructor request callback.

This change adds a generic implementation to Resource::Private which is
now used by all inheriting classes replacing the custom implementations.

Test Plan:
For a few Resources the test is extended to ensure that the Resource
gets deleted on server side.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1679
2016-05-30 08:16:07 +02:00
Martin Gräßlin
65a79d98da [autotests] Switch all tests to GUILESS_MAIN 2015-11-11 08:36:31 +01:00
Marco Martin
1f4beb0334 Wayland protocol for background contrast
new wayland protocol used to define regions behind a window
in which the kwin background contrast effect should be applied
REVIEW:125030
2015-09-03 16:12:23 +02:00