Commit 14d052d9 authored by Martin Flöser's avatar Martin Flöser
Browse files

Remove client credentials from ShellSurface

It's now part of ClientConnection, where it makes more sense.

This allowed to make Resource::Private::create non-virtual.
parent c71cf399
......@@ -33,7 +33,7 @@ class Resource::Private
virtual ~Private();
virtual void create(ClientConnection *client, quint32 version, quint32 id);
void create(ClientConnection *client, quint32 version, quint32 id);
wl_resource *resource = nullptr;
ClientConnection *client = nullptr;
......@@ -66,15 +66,11 @@ class ShellSurfaceInterface::Private : public Resource::Private
Private(ShellSurfaceInterface *q, ShellInterface *shell, SurfaceInterface *surface);
void create(ClientConnection *client, quint32 version, quint32 id) override;
void setFullscreen(bool fullscreen);
void setToplevel(bool toplevel);
void ping();
SurfaceInterface *surface;
pid_t clientPid = 0;
uid_t clientUser = 0;
gid_t clientGroup = 0;
QString title;
QByteArray windowClass;
QScopedPointer<QTimer> pingTimer;
......@@ -206,12 +202,6 @@ ShellSurfaceInterface::ShellSurfaceInterface(ShellInterface *shell, SurfaceInter
ShellSurfaceInterface::~ShellSurfaceInterface() = default;
void ShellSurfaceInterface::Private::create(ClientConnection *c, quint32 version, quint32 id)
Resource::Private::create(c, version, id);
wl_client_get_credentials(*client, &clientPid, &clientUser, &clientGroup);
void ShellSurfaceInterface::Private::pongCallback(wl_client *client, wl_resource *resource, uint32_t serial)
auto s = cast<Private>(resource);
......@@ -421,21 +411,6 @@ bool ShellSurfaceInterface::isToplevel() const {
return d->toplevel;
pid_t ShellSurfaceInterface::clientPid() const {
return d->clientPid;
uid_t ShellSurfaceInterface::clientUser() const {
return d->clientUser;
gid_t ShellSurfaceInterface::clientGroup() const {
return d->clientGroup;
ShellSurfaceInterface::Private *ShellSurfaceInterface::d_func() const
return reinterpret_cast<ShellSurfaceInterface::Private*>(;
......@@ -77,11 +77,6 @@ public:
bool isFullscreen() const;
bool isToplevel() const;
// TODO: keep them here or add a better encapsulation?
pid_t clientPid() const;
uid_t clientUser() const;
gid_t clientGroup() const;
void titleChanged(const QString&);
void windowClassChanged(const QByteArray&);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment