From fb118a9343bcbe84632d3913c0dfed2f3a9c30f8 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Fri, 21 Aug 2020 15:44:52 +0200 Subject: [PATCH] Expose the toplevel's pid in the scripting API This allows scripts to obtain the process behind a window, which can be useful for doing app-specific things in a script. --- toplevel.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/toplevel.h b/toplevel.h index b53e52de60..19a717d001 100644 --- a/toplevel.h +++ b/toplevel.h @@ -284,6 +284,13 @@ class KWIN_EXPORT Toplevel : public QObject */ Q_PROPERTY(QUuid internalId READ internalId CONSTANT) + /** + * The pid of the process owning this window. + * + * @since 5.20 + */ + Q_PROPERTY(int pid READ pid CONSTANT) + public: explicit Toplevel(); virtual xcb_window_t frameId() const;