[EffectWindow] Expose PID to effects

Differential Revision: https://phabricator.kde.org/D24222
This commit is contained in:
Kai Uwe Broulik 2019-09-26 14:54:33 +02:00
parent 0cacd9dc0a
commit 321e17ab68
4 changed files with 18 additions and 0 deletions

View file

@ -254,6 +254,9 @@ public:
bool isOutline() const override {
return false;
}
pid_t pid() const override {
return 0;
}
private:
qreal m_opacity = 1.0;

View file

@ -1840,6 +1840,7 @@ TOPLEVEL_HELPER(bool, skipsCloseAnimation, skipsCloseAnimation)
TOPLEVEL_HELPER(KWayland::Server::SurfaceInterface *, surface, surface)
TOPLEVEL_HELPER(bool, isPopupWindow, isPopupWindow)
TOPLEVEL_HELPER(bool, isOutline, isOutline)
TOPLEVEL_HELPER(pid_t, pid, pid)
#undef TOPLEVEL_HELPER

View file

@ -462,6 +462,8 @@ public:
bool isWaylandClient() const override;
bool isX11Client() const override;
pid_t pid() const override;
QRect decorationInnerRect() const override;
QByteArray readProperty(long atom, long type, int format) const override;
void deleteProperty(long atom) const override;

View file

@ -2086,6 +2086,13 @@ class KWINEFFECTS_EXPORT EffectWindow : public QObject
*/
Q_PROPERTY(bool outline READ isOutline CONSTANT)
/**
* The PID of the application this window belongs to.
*
* @since 5.18
*/
Q_PROPERTY(bool outline READ isOutline CONSTANT)
public:
/** Flags explaining why painting should be disabled */
enum {
@ -2385,6 +2392,11 @@ public:
*/
virtual bool isOutline() const = 0;
/**
* @since 5.18
*/
virtual pid_t pid() const = 0;
/**
* Can be used to by effects to store arbitrary data in the EffectWindow.
*