diff --git a/frame/layershell/x11dlayershellemulation.cpp b/frame/layershell/x11dlayershellemulation.cpp index d871812e0..3c489dc09 100644 --- a/frame/layershell/x11dlayershellemulation.cpp +++ b/frame/layershell/x11dlayershellemulation.cpp @@ -55,6 +55,7 @@ LayerShellEmulation::LayerShellEmulation(QWindow* window, QObject *parent) connect(qApp, &QGuiApplication::screenAdded, this, [this] (const QScreen *newScreen) { connect(newScreen, &QScreen::geometryChanged, this, &LayerShellEmulation::onPositionChanged); connect(newScreen, &QScreen::geometryChanged, &m_exclusionZoneChangedTimer, static_cast(&QTimer::start)); + m_exclusionZoneChangedTimer.start(); }); connect(qApp, &QGuiApplication::primaryScreenChanged, &m_exclusionZoneChangedTimer, static_cast(&QTimer::start)); connect(m_window, &QWindow::screenChanged, this, [this](QScreen *nowScreen){ @@ -62,6 +63,8 @@ LayerShellEmulation::LayerShellEmulation(QWindow* window, QObject *parent) m_exclusionZoneChangedTimer.start(); }); + connect(qApp, &QGuiApplication::screenRemoved, &m_exclusionZoneChangedTimer, static_cast(&QTimer::start)); + // connect(m_dlayerShellWindow, &DS_NAMESPACE::DLayerShellWindow::keyboardInteractivityChanged, this, &LayerShellEmulation::onKeyboardInteractivityChanged); } @@ -188,7 +191,7 @@ void LayerShellEmulation::onExclusionZoneChanged() if (boundary < screen->geometry().bottom()) boundary = screen->geometry().bottom(); } - strut_partial.bottom = + boundary - rect.bottom() + (m_dlayerShellWindow->exclusionZone()) * scaleFactor; + strut_partial.bottom = boundary - rect.bottom() + (m_dlayerShellWindow->exclusionZone()) * scaleFactor; strut_partial.bottom_start_x = rect.x(); strut_partial.bottom_end_x = rect.x() + m_window->width(); }