Commit graph

16 commits

Author SHA1 Message Date
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
43cfd25d27 Search for Xwayland surfaces differently
Currently, we store all surfaces in a single list and use linear search
to find the SurfaceInterface by its object id and client connection.

With this, we first search for the wl_resource object by its id. Once we
have a wl_resource, SurfaceInterface::get(wl_resource) can be used.

The main advantage of the proposed solution is that we don't need to
maintain a static list with all SurfaceInterface objects.
2021-07-28 14:38:01 +03:00
Vlad Zahorodnii
ba3f587200 Drop ClientConnection::createResource()
It's leftover after now gone Global and Resource.
2021-07-28 14:21:11 +03:00
Laurent Montel
0c49d302ce Use Q_EMIT to make it compile against kf5.82 2021-05-13 11:33:08 +02:00
Vlad Zahorodnii
c2fc33872e Introduce ClientConnection::aboutToBeDestroyed
This signal is useful if the compositor wants to perform some cleanup
before the disconnected signal is emitted or while the connection object
still has valid wl_client native handle.
2021-05-12 22:39:07 +03:00
Vlad Zahorodnii
f16320e693 Don't use nested private class in ClientConnection
Nested private classes are highly discouraged in KWaylandServer due to
their flaws, e.g. it's very easy to forget to put Q_DECL_HIDDEN, etc.
2021-04-06 06:45:39 +00:00
Vlad Zahorodnii
13fa83c7a6 Make some getters in ClientConnection const 2021-02-17 12:18:21 +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
Martin Gräßlin
0649c8e51e [server] Use deleteLater when a ClientConnection gets destroyed
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
2016-10-11 07:41:17 +02:00
Martin Gräßlin
565c832d39 [server] Expose executable path in ClientConnection
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
2016-01-25 10:56:16 +01:00
Martin Gräßlin
868282fb08 [server] Add a convenient ClientConnection::destroy
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
2015-11-10 13:31:47 +01:00
Martin Gräßlin
3a01f7155a [server] Add ClientConnection::getResource
Returns the wl_resource associated with a given id for the client
if it exists.
2015-04-02 14:12:16 +02:00
Martin Gräßlin
b243eea6cd Add createResource to ClientConnection
One place to rule all createResource calls.
2014-11-19 19:01:15 +01:00
Martin Gräßlin
fce51fb313 Add a flush to ClientConnection 2014-11-19 17:02:27 +01:00
Martin Gräßlin
8f11a2b0e5 Adding a new ClientConnection class for wrapping wl_client
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.
2014-11-17 16:01:18 +01:00