diff --git a/src/abstract_client.h b/src/abstract_client.h index 523308e9c3..2c6377499f 100644 --- a/src/abstract_client.h +++ b/src/abstract_client.h @@ -75,9 +75,16 @@ class KWIN_EXPORT AbstractClient : public Toplevel /** * The desktop this Client is on. If the Client is on all desktops the property has value -1. * This is a legacy property, use x11DesktopIds instead + * + * @deprecated Use the desktops property instead. */ Q_PROPERTY(int desktop READ desktop WRITE setDesktop NOTIFY desktopChanged) + /** + * The virtual desktops this client is on. If it's on all desktops, the list is empty. + */ + Q_PROPERTY(QVector desktops READ desktops WRITE setDesktops NOTIFY desktopChanged) + /** * Whether the Client is on all desktops. That is desktop is -1. */ @@ -90,6 +97,8 @@ class KWIN_EXPORT AbstractClient : public Toplevel /** * The x11 ids for all desktops this client is in. On X11 this list will always have a length of 1 + * + * @deprecated prefer using apis that use VirtualDesktop objects */ Q_PROPERTY(QVector x11DesktopIds READ x11DesktopIds NOTIFY x11DesktopIdsChanged) diff --git a/src/scripting/scripting.cpp b/src/scripting/scripting.cpp index e6f15d0655..b901db7455 100644 --- a/src/scripting/scripting.cpp +++ b/src/scripting/scripting.cpp @@ -24,6 +24,7 @@ #include "input.h" #include "options.h" #include "screenedge.h" +#include "virtualdesktops.h" #include "workspace.h" #include "x11client.h" // KDE @@ -656,6 +657,7 @@ void KWin::Scripting::init() }); qmlRegisterType(); + qmlRegisterType(); qmlRegisterType(); qmlRegisterType();