Add signal to Scripting when number of screens changes
This commit is contained in:
parent
27643f5a9e
commit
cd8a18080f
2 changed files with 9 additions and 1 deletions
|
@ -22,6 +22,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "workspace_wrapper.h"
|
||||
#include "../client.h"
|
||||
|
||||
#include <QtGui/QDesktopWidget>
|
||||
|
||||
namespace KWin {
|
||||
|
||||
WorkspaceWrapper::WorkspaceWrapper(QObject* parent) : QObject(parent)
|
||||
|
@ -35,6 +37,7 @@ WorkspaceWrapper::WorkspaceWrapper(QObject* parent) : QObject(parent)
|
|||
connect(ws, SIGNAL(clientActivated(KWin::Client*)), SIGNAL(clientActivated(KWin::Client*)));
|
||||
connect(ws, SIGNAL(numberDesktopsChanged(int)), SIGNAL(numberDesktopsChanged(int)));
|
||||
connect(ws, SIGNAL(clientDemandsAttentionChanged(KWin::Client*,bool)), SIGNAL(clientDemandsAttentionChanged(KWin::Client*,bool)));
|
||||
connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), SIGNAL(numberScreensChanged(int)));
|
||||
foreach (KWin::Client *client, ws->clientList()) {
|
||||
setupClientConnections(client);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ class WorkspaceWrapper : public QObject
|
|||
**/
|
||||
Q_PROPERTY(int displayHeight READ displayHeight)
|
||||
Q_PROPERTY(int activeScreen READ activeScreen)
|
||||
Q_PROPERTY(int numScreens READ numScreens)
|
||||
Q_PROPERTY(int numScreens READ numScreens NOTIFY numberScreensChanged)
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(WorkspaceWrapper)
|
||||
|
@ -92,6 +92,11 @@ signals:
|
|||
* @param set New value of demands attention
|
||||
**/
|
||||
void clientDemandsAttentionChanged(KWin::Client *client, bool set);
|
||||
/**
|
||||
* Signal emitted when the number of screens changes.
|
||||
* @param count The new number of screens
|
||||
**/
|
||||
void numberScreensChanged(int count);
|
||||
|
||||
public:
|
||||
//------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue