diff --git a/app/dockview.cpp b/app/dockview.cpp index 1c1735835..2ab783970 100644 --- a/app/dockview.cpp +++ b/app/dockview.cpp @@ -256,6 +256,7 @@ void DockView::setScreenToFollow(QScreen *screen, bool updateScreenId) this->containment()->reactToScreenChange(); syncGeometry(); + updateAbsDockGeometry(true); emit screenGeometryChanged(); } @@ -319,6 +320,13 @@ void DockView::reconsiderScreen() void DockView::screenChanged(QScreen *scr) { m_screenSyncTimer.start(); + + //! this is needed in order to update the struts on screen change + //! and even though the geometry has been set correctly the offsets + //! of the screen must be updated to the new ones + if (m_visibility && m_visibility->mode() == Latte::Dock::AlwaysVisible) { + updateAbsDockGeometry(true); + } } void DockView::addNewDock() @@ -526,12 +534,12 @@ void DockView::setLocalGeometry(const QRect &geometry) updateAbsDockGeometry(); } -void DockView::updateAbsDockGeometry() +void DockView::updateAbsDockGeometry(bool bypassChecks) { QRect absGeometry {x() + m_localGeometry.x(), y() + m_localGeometry.y() , m_localGeometry.width() - 1, m_localGeometry.height() - 1}; - if (m_absGeometry == absGeometry) + if (m_absGeometry == absGeometry && !bypassChecks) return; m_absGeometry = absGeometry; diff --git a/app/dockview.h b/app/dockview.h index f3e6f32ab..02b66a57b 100644 --- a/app/dockview.h +++ b/app/dockview.h @@ -163,7 +163,7 @@ public slots: Q_INVOKABLE void closeApplication(); - void updateAbsDockGeometry(); + void updateAbsDockGeometry(bool bypassChecks = false); protected slots: void showConfigurationInterface(Plasma::Applet *applet) override;