window: expose "output" property

This allows it to be used from QML KWin Script or via property() C++
call.

This is useful to be able to use client area function with pointers
API without falling back to VirtualDesktop X11 ids from scripts.
This commit is contained in:
Mikhail Zolotukhin 2022-08-11 14:39:21 +03:00
parent 6982c506a5
commit f6054863e1
No known key found for this signature in database
GPG key ID: 0B69BFDDC84502BD

View file

@ -121,7 +121,17 @@ class KWIN_EXPORT Window : public QObject
Q_PROPERTY(QRectF visibleRect READ visibleGeometry)
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged)
/**
* The screen where the window center is on
*/
Q_PROPERTY(int screen READ screen NOTIFY screenChanged)
/**
* The output (screen) where the window center is on
*/
Q_PROPERTY(KWin::Output *output READ output NOTIFY screenChanged)
Q_PROPERTY(qulonglong windowId READ window CONSTANT)
Q_PROPERTY(QRectF rect READ rect)
@ -631,7 +641,7 @@ public:
qreal height() const;
bool isOnOutput(Output *output) const;
bool isOnActiveOutput() const;
int screen() const; // the screen where the center is
int screen() const;
Output *output() const;
void setOutput(Output *output);
virtual QPointF clientPos() const