Skip to content

Commit 263b6df

Browse files
committed
fix: need update exclusion zone when screen was added or removed
as title Log: as title Pms: BUG-306339
1 parent 6bbbff2 commit 263b6df

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

frame/layershell/x11dlayershellemulation.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,16 @@ LayerShellEmulation::LayerShellEmulation(QWindow* window, QObject *parent)
5555
connect(qApp, &QGuiApplication::screenAdded, this, [this] (const QScreen *newScreen) {
5656
connect(newScreen, &QScreen::geometryChanged, this, &LayerShellEmulation::onPositionChanged);
5757
connect(newScreen, &QScreen::geometryChanged, &m_exclusionZoneChangedTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
58+
m_exclusionZoneChangedTimer.start();
5859
});
5960
connect(qApp, &QGuiApplication::primaryScreenChanged, &m_exclusionZoneChangedTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
6061
connect(m_window, &QWindow::screenChanged, this, [this](QScreen *nowScreen){
6162
onPositionChanged();
6263
m_exclusionZoneChangedTimer.start();
6364
});
6465

66+
connect(qApp, &QGuiApplication::screenRemoved, &m_exclusionZoneChangedTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
67+
6568
// connect(m_dlayerShellWindow, &DS_NAMESPACE::DLayerShellWindow::keyboardInteractivityChanged, this, &LayerShellEmulation::onKeyboardInteractivityChanged);
6669
}
6770

@@ -188,7 +191,7 @@ void LayerShellEmulation::onExclusionZoneChanged()
188191
if (boundary < screen->geometry().bottom())
189192
boundary = screen->geometry().bottom();
190193
}
191-
strut_partial.bottom = + boundary - rect.bottom() + (m_dlayerShellWindow->exclusionZone()) * scaleFactor;
194+
strut_partial.bottom = boundary - rect.bottom() + (m_dlayerShellWindow->exclusionZone()) * scaleFactor;
192195
strut_partial.bottom_start_x = rect.x();
193196
strut_partial.bottom_end_x = rect.x() + m_window->width();
194197
}

0 commit comments

Comments
 (0)