Adding NOTIFY signals to desktopGrid(Size/Width/Height)

Since the introduction of VirtualDesktopManager we do have a signal
emitted when the desktop layout changes which we can use as NOTIFY for
the desktopGrid properties.

REVIEW: 108953
This commit is contained in:
Martin Gräßlin 2013-02-14 09:36:00 +01:00
parent 3389d68c50
commit 25bb1482e3
2 changed files with 10 additions and 3 deletions

View file

@ -39,6 +39,7 @@ WorkspaceWrapper::WorkspaceWrapper(QObject* parent) : QObject(parent)
connect(ws, SIGNAL(clientRemoved(KWin::Client*)), SIGNAL(clientRemoved(KWin::Client*)));
connect(ws, SIGNAL(clientActivated(KWin::Client*)), SIGNAL(clientActivated(KWin::Client*)));
connect(vds, SIGNAL(countChanged(uint,uint)), SIGNAL(numberDesktopsChanged(uint)));
connect(vds, SIGNAL(layoutChanged(int,int)), SIGNAL(desktopLayoutChanged()));
connect(ws, SIGNAL(clientDemandsAttentionChanged(KWin::Client*,bool)), SIGNAL(clientDemandsAttentionChanged(KWin::Client*,bool)));
connect(ws, SIGNAL(currentActivityChanged(QString)), SIGNAL(currentActivityChanged(QString)));
connect(ws, SIGNAL(activityAdded(QString)), SIGNAL(activitiesChanged(QString)));

View file

@ -40,9 +40,9 @@ class WorkspaceWrapper : public QObject
Q_PROPERTY(int currentDesktop READ currentDesktop WRITE setCurrentDesktop NOTIFY currentDesktopChanged)
Q_PROPERTY(KWin::Client *activeClient READ activeClient WRITE setActiveClient NOTIFY clientActivated)
// TODO: write and notify?
Q_PROPERTY(QSize desktopGridSize READ desktopGridSize)
Q_PROPERTY(int desktopGridWidth READ desktopGridWidth)
Q_PROPERTY(int desktopGridHeight READ desktopGridHeight)
Q_PROPERTY(QSize desktopGridSize READ desktopGridSize NOTIFY desktopLayoutChanged)
Q_PROPERTY(int desktopGridWidth READ desktopGridWidth NOTIFY desktopLayoutChanged)
Q_PROPERTY(int desktopGridHeight READ desktopGridHeight NOTIFY desktopLayoutChanged)
Q_PROPERTY(int workspaceWidth READ workspaceWidth)
Q_PROPERTY(int workspaceHeight READ workspaceHeight)
Q_PROPERTY(QSize workspaceSize READ workspaceSize)
@ -90,6 +90,12 @@ signals:
* @param oldNumberOfDesktops The previous number of desktops.
**/
void numberDesktopsChanged(uint oldNumberOfDesktops);
/**
* Signal emitted whenever the layout of virtual desktops changed.
* That is desktopGrid(Size/Width/Height) will have new values.
* @since 4.11
**/
void desktopLayoutChanged();
/**
* The demands attention state for Client @p c changed to @p set.
* @param c The Client for which demands attention changed