@@ -57,7 +57,7 @@ public:
57 m_connectedWindow = w;
57 m_connectedWindow = w;
60− connect(w, &ScreenWindow::heightChanged, this, [this](int height) {
60+ connect(w, &QWindow::heightChanged, this, [this](int height) {
61 if (height == 0 || height == m_sizes.first()->size.rheight()) {
61 if (height == 0 || height == m_sizes.first()->size.rheight()) {
@@ -65,15 +65,20 @@ public:
65 Q_EMIT availableModesChanged();
65 Q_EMIT availableModesChanged();
68− connect(w, &ScreenWindow::widthChanged, this, [this](int width) {
68+ connect(w, &QWindow::widthChanged, this, [this](int width) {
69 if (width == 0 || width == m_sizes.first()->size.rwidth()) {
69 if (width == 0 || width == m_sizes.first()->size.rwidth()) {
72 m_sizes.first()->size.rwidth() = width;
72 m_sizes.first()->size.rwidth() = width;
73 Q_EMIT availableModesChanged();
73 Q_EMIT availableModesChanged();
75+ connect(w, &QWindow::activeChanged, this, [w, this]() {
76+ if (w->isActive()) setActive(true);
78+ if (w->isActive()) setActive(true);
76 Q_EMIT availableModesChanged();
80 Q_EMIT availableModesChanged();
@@ -170,6 +175,14 @@ MockScreens::MockScreens()
170 m_mocks.append(screen);
175 m_mocks.append(screen);
172 lastPoint.rx() += screen->m_sizes[screen->m_currentModeIndex]->size.width();
177 lastPoint.rx() += screen->m_sizes[screen->m_currentModeIndex]->size.width();
179+ connect(screen, &qtmir::Screen::activeChanged, this, [=](bool active) {
180+ Q_FOREACH(auto otherScreen, m_mocks) {
181+ if (active && otherScreen != screen) {
182+ otherScreen->setActive(false);