Verified Commit cea5cba3 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
FIXED-IN: 5.24.6
parent 8faab6bc
Pipeline #194154 passed with stage
in 11 minutes and 32 seconds
......@@ -93,6 +93,10 @@ 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);
}
}
// qDebug() << "adapting to screen" << m_screenToFollow->name() << this;
if (m_oldScreen) {
......@@ -103,6 +107,10 @@ void DesktopView::adaptToScreen()
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;
......
......@@ -846,10 +846,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