Verified Commit 41fb8215 authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

shell: refresh geometries of all `DesktopView` and `PanelView` when receiving...

shell: refresh geometries of all `DesktopView` and `PanelView` when receiving `logicalDotsPerInchChanged`

Workaround for https://codereview.qt-project.org/c/qt/qtbase/+/413380

BUG: 450443
BUG: 438114
FIXED-IN: 5.24.6

(cherry picked from cea5cba3)
parent d159d05b
......@@ -118,12 +118,20 @@ void DesktopView::adaptToScreen()
if (m_oldScreen) {
disconnect(m_oldScreen.data(), &QScreen::geometryChanged, this, &DesktopView::screenGeometryChanged);
// Workaround for https://codereview.qt-project.org/c/qt/qtbase/+/413380
if (KWindowSystem::isPlatformX11()) {
disconnect(m_oldScreen.data(), &QScreen::logicalDotsPerInchChanged, this, &DesktopView::screenGeometryChanged);
}
}
if (m_windowType == Desktop || m_windowType == WindowedDesktop) {
screenGeometryChanged();
connect(m_screenToFollow.data(), &QScreen::geometryChanged, this, &DesktopView::screenGeometryChanged, Qt::UniqueConnection);
// Workaround for https://codereview.qt-project.org/c/qt/qtbase/+/413380
if (KWindowSystem::isPlatformX11()) {
connect(m_screenToFollow.data(), &QScreen::logicalDotsPerInchChanged, this, &DesktopView::screenGeometryChanged, Qt::UniqueConnection);
}
}
m_oldScreen = m_screenToFollow;
......
......@@ -935,10 +935,18 @@ void PanelView::setScreenToFollow(QScreen *screen)
// disconnect from old screen
disconnect(m_screenToFollow, &QScreen::virtualGeometryChanged, this, &PanelView::updateStruts);
disconnect(m_screenToFollow, &QScreen::geometryChanged, this, &PanelView::restore);
// Workaround for https://codereview.qt-project.org/c/qt/qtbase/+/413380
if (KWindowSystem::isPlatformX11()) {
disconnect(m_screenToFollow, &QScreen::logicalDotsPerInchChanged, this, &PanelView::restore);
}
}
connect(screen, &QScreen::virtualGeometryChanged, this, &PanelView::updateStruts, Qt::UniqueConnection);
connect(screen, &QScreen::geometryChanged, this, &PanelView::restore, Qt::UniqueConnection);
// Workaround for https://codereview.qt-project.org/c/qt/qtbase/+/413380
if (KWindowSystem::isPlatformX11()) {
connect(screen, &QScreen::logicalDotsPerInchChanged, this, &PanelView::restore, Qt::UniqueConnection);
}
/*connect(screen, &QObject::destroyed, this, [this]() {
if (PanelView::screen()) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment