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.
This commit is contained in:
Nicolas Fella 2020-08-21 15:44:52 +02:00
parent 90b53f416c
commit fb118a9343

View file

@ -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;