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.
Since both output-management-v2 protocol implementation and the rest of
kwin live in the same place and the fact that kde-output-management-v2
is very plasma specific, we can move Platform::requestOutputsChange() to
the implementation of kde-output-management-v2 protocol, it simplifies
the code a bit and improve code encapsulation.
In order to further simplify kde-output-management-v2 protocol, this
change alters the behavior of the protocol so an output configuration
can be applied only once, which is a very reasonable behavior.
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.
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.
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.
Summary:
If automaticSocketNaming is enabled, it will use wl_display_add_socket_auto
to allocate the next free socket. The resulting name can be retrieved using
socketName after a successful start afterwards.
Test Plan: Ran the new autotest, passes. kwin_wayland still uses the old behaviour.
Reviewers: #kwin, #plasma, romangg
Reviewed By: #kwin, #plasma, romangg
Subscribers: davidedmundson, zzag, romangg, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D17122
Summary:
- selfInitialization
- memleak
I could probably suppress the selfInitialization warning, but probably
is cleaner this way. Opinions welcome. This also fixes the memleak in
autotest.
Test Plan:
- arc lint --everything
- Fix issues
- build
- run tests
Reviewers: #frameworks, aacid
Reviewed By: aacid
Subscribers: apol, aacid, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D13559
Summary:
This fixes the check in the unittest when doing
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
which I intend to do globally at some point.
Turns out it's comparing with its own executable location, so we
can use QCoreApplication to get it generically.
Test Plan: Verified to work with ctest and with "./testWaylandServerDisplay"
Reviewers: graesslin, mart
Reviewed By: graesslin, mart
Subscribers: plasma-devel, #frameworks
Tags: #plasma_on_wayland, #frameworks
Differential Revision: https://phabricator.kde.org/D6974
Summary:
In the situation that a wl_client gets destroyed while still
wl_resources are around it can happen that one of them calls into the
ClientConnection during the cleanup handling which gets triggered at the
same time. This can then trigger a crash.
This change uses deleteLater for the ClientConnection and sets the hold
wl_client pointer to null instead of deleting directly. So the
ClientConnection is still around while the Resources gets cleaned up.
This is similar to the cleanup of Resource where on unbind the
wl_resource pointer is set to null and the Resource gets delete later.
BUG: 370232
FIXED-IN: 5.28
Reviewers: #plasma, bshah
Subscribers: plasma-devel
Tags: #plasma_on_wayland
Differential Revision: https://phabricator.kde.org/D3004
Summary: Convenient API to get the absolute executable path for the pid.
Reviewers: sebas, mart
Subscribers: plasma-devel
Differential Revision: https://phabricator.kde.org/D858
Wrapper around wl_client_destroy. In case the ClientConnection got
created through Display::createClient we need to destroy the
ClientConnection again. The exiting client will not cause it to be
destroyed.
Reviewed-By: Bhushan Shah
If one passes StartMode::ConnectClientsOnly the socket in
XDG_RUNTIME_DIR is not created and instead one can only connect to
this server using the Display::createClient method. A very nice
solution to just have a Server and one dedicated Client talk to each
other.
The ClientConnection is managed by Display. Whenever one tries to
get a ClientConnection for a wl_client* and it doesn't exist yet a
new one will be created and a clientConnected signal will be emitted.
Also there is a clientDisconnected signal.
ClientConnection provides access to pid, uid and gid. The idea is
to extend it to provide access to all the resources created for the
client.
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.