fix #432,signal update struts on dock screenchange

pull/1/head
Michail Vourlakos 8 years ago
parent dee8ebcf8b
commit bd9021a412

@ -256,6 +256,7 @@ void DockView::setScreenToFollow(QScreen *screen, bool updateScreenId)
this->containment()->reactToScreenChange(); this->containment()->reactToScreenChange();
syncGeometry(); syncGeometry();
updateAbsDockGeometry(true);
emit screenGeometryChanged(); emit screenGeometryChanged();
} }
@ -319,6 +320,13 @@ void DockView::reconsiderScreen()
void DockView::screenChanged(QScreen *scr) void DockView::screenChanged(QScreen *scr)
{ {
m_screenSyncTimer.start(); 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() void DockView::addNewDock()
@ -526,12 +534,12 @@ void DockView::setLocalGeometry(const QRect &geometry)
updateAbsDockGeometry(); updateAbsDockGeometry();
} }
void DockView::updateAbsDockGeometry() void DockView::updateAbsDockGeometry(bool bypassChecks)
{ {
QRect absGeometry {x() + m_localGeometry.x(), y() + m_localGeometry.y() QRect absGeometry {x() + m_localGeometry.x(), y() + m_localGeometry.y()
, m_localGeometry.width() - 1, m_localGeometry.height() - 1}; , m_localGeometry.width() - 1, m_localGeometry.height() - 1};
if (m_absGeometry == absGeometry) if (m_absGeometry == absGeometry && !bypassChecks)
return; return;
m_absGeometry = absGeometry; m_absGeometry = absGeometry;

@ -163,7 +163,7 @@ public slots:
Q_INVOKABLE void closeApplication(); Q_INVOKABLE void closeApplication();
void updateAbsDockGeometry(); void updateAbsDockGeometry(bool bypassChecks = false);
protected slots: protected slots:
void showConfigurationInterface(Plasma::Applet *applet) override; void showConfigurationInterface(Plasma::Applet *applet) override;

Loading…
Cancel
Save