diff --git a/abstract_client.cpp b/abstract_client.cpp index 72c68dcf65..79fb0bd7ac 100644 --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -704,6 +704,7 @@ void AbstractClient::setupWindowManagementInterface() }; updateAppId(); w->setSkipTaskbar(skipTaskbar()); + w->setPid(pid()); w->setShadeable(isShadeable()); w->setShaded(isShade()); w->setResizable(isResizable()); diff --git a/shell_client.cpp b/shell_client.cpp index 8fe20a2078..8ff3172e8d 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -980,6 +980,11 @@ void ShellClient::updateInternalWindowGeometry() 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/shell_client.h b/shell_client.h index 24a46faf49..eba74cfb7c 100644 --- a/shell_client.h +++ b/shell_client.h @@ -108,6 +108,15 @@ public: 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/toplevel.h b/toplevel.h index cb604ea1e3..f50314e6eb 100644 --- a/toplevel.h +++ b/toplevel.h @@ -295,7 +295,7 @@ public: 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