diff --git a/abstract_client.cpp b/abstract_client.cpp --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -704,6 +704,7 @@ }; updateAppId(); w->setSkipTaskbar(skipTaskbar()); + w->setPid(pid()); w->setShadeable(isShadeable()); w->setShaded(isShade()); w->setResizable(isResizable()); diff --git a/shell_client.h b/shell_client.h --- a/shell_client.h +++ b/shell_client.h @@ -108,6 +108,15 @@ quint32 windowId() const override { return m_windowId; } + + /** + * The process for this client. + * Note that processes started by kwin will share its process id. + * @since 5.11 + * @returns the process if for this client. + **/ + pid_t pid() const override; + bool isInternal() const; bool isLockScreen() const override; bool isInputMethod() const override; diff --git a/shell_client.cpp b/shell_client.cpp --- a/shell_client.cpp +++ b/shell_client.cpp @@ -981,6 +981,11 @@ m_internalWindow->geometry().size() + QSize(borderLeft() + borderRight(), borderTop() + borderBottom()))); } +pid_t ShellClient::pid() const +{ + return surface()->client()->processId(); +} + bool ShellClient::isInternal() const { return m_internal; diff --git a/toplevel.h b/toplevel.h --- a/toplevel.h +++ b/toplevel.h @@ -289,7 +289,7 @@ QByteArray wmClientMachine(bool use_localhost) const; const ClientMachine *clientMachine() const; Window wmClientLeader() const; - pid_t pid() const; + virtual pid_t pid() const; static bool resourceMatch(const Toplevel* c1, const Toplevel* c2); bool readyForPainting() const; // true if the window has been already painted its contents