From e195c1d01f8c0d2500e8a83a2b37a19898e42f2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 24 Mar 2012 10:51:12 +0100 Subject: [PATCH] Export WindowId on Plasma Dialog Exporting the window Id allows to use it in declarative KWin scripts to embedd window thumbnails on the dialog. REVIEW: 104393 --- declarativeimports/core/dialog.cpp | 5 +++++ declarativeimports/core/dialog.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/declarativeimports/core/dialog.cpp b/declarativeimports/core/dialog.cpp index 1d6c2ca1d..427927dc0 100644 --- a/declarativeimports/core/dialog.cpp +++ b/declarativeimports/core/dialog.cpp @@ -350,6 +350,11 @@ int DialogProxy::windowFlags() const return (int)m_flags; } +qulonglong DialogProxy::windowId() const +{ + return m_dialog->winId(); +} + void DialogProxy::setWindowFlags(const int flags) { /*X misbehaviour: the only way to make a window with the Popup flag working, is to create it with that flag from the beginning*/ diff --git a/declarativeimports/core/dialog.h b/declarativeimports/core/dialog.h index 33ab07af2..1864eb736 100644 --- a/declarativeimports/core/dialog.h +++ b/declarativeimports/core/dialog.h @@ -140,6 +140,11 @@ class DialogProxy : public QObject */ Q_PROPERTY(int location READ location WRITE setLocation NOTIFY locationChanged) + /** + * Window ID of the dialog window. + **/ + Q_PROPERTY(qulonglong windowId READ windowId CONSTANT) + public: enum WidgetAttribute { WA_X11NetWmWindowTypeDock = Qt::WA_X11NetWmWindowTypeDock @@ -180,6 +185,8 @@ public: QObject *margins() const; + qulonglong windowId() const; + /** * @returns The suggested screen position for the popup * @arg item the item the popup has to be positioned relatively to. if null, the popup will be positioned in the center of the window