From 11226428c6ce40a5d304c152903e57ea03821562 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 9 Mar 2019 15:58:16 +0200 Subject: [PATCH] update config window availScreenGeometry properly --- app/view/settings/primaryconfigview.cpp | 17 ++++++++++++++--- app/view/settings/primaryconfigview.h | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/view/settings/primaryconfigview.cpp b/app/view/settings/primaryconfigview.cpp index 2a6df64a3..1441a8e54 100644 --- a/app/view/settings/primaryconfigview.cpp +++ b/app/view/settings/primaryconfigview.cpp @@ -69,6 +69,7 @@ PrimaryConfigView::PrimaryConfigView(Plasma::Containment *containment, Latte::Vi m_screenSyncTimer.setSingleShot(true); m_screenSyncTimer.setInterval(100); + connect(this, &PrimaryConfigView::availableScreenGeometryChanged, this, &PrimaryConfigView::syncGeometry); connect(this, &PrimaryConfigView::complexityChanged, this, &PrimaryConfigView::saveConfig); connect(this, &PrimaryConfigView::complexityChanged, this, &PrimaryConfigView::updateShowInlineProperties); connect(this, &PrimaryConfigView::complexityChanged, this, &PrimaryConfigView::syncGeometry); @@ -92,6 +93,10 @@ PrimaryConfigView::PrimaryConfigView(Plasma::Containment *containment, Latte::Vi m_thicknessSyncTimer.start(); }); + connections << connect(m_corona, &Latte::Corona::availableScreenRectChanged, this, [this]() { + updateAvailableScreenGeometry(); + }); + if (m_corona) { connections << connect(m_corona, &Latte::Corona::raiseViewsTemporaryChanged, this, &PrimaryConfigView::raiseDocksTemporaryChanged); } @@ -146,9 +151,7 @@ void PrimaryConfigView::init() QByteArray tempFilePath = "lattedockconfigurationui"; updateEnabledBorders(); - - int currentScrId = m_latteView->positioner()->currentScreenId(); - m_availableScreenGeometry = m_corona->availableScreenRect(currentScrId); + updateAvailableScreenGeometry(); auto source = QUrl::fromLocalFile(m_latteView->containment()->corona()->kPackage().filePath(tempFilePath)); setSource(source); @@ -185,6 +188,14 @@ void PrimaryConfigView::deleteSecondaryWindow() } } +void PrimaryConfigView::updateAvailableScreenGeometry() +{ + int currentScrId = m_latteView->positioner()->currentScreenId(); + m_availableScreenGeometry = m_corona->availableScreenRect(currentScrId); + + emit availableScreenGeometryChanged(); +} + QRect PrimaryConfigView::availableScreenGeometry() const { return m_availableScreenGeometry; diff --git a/app/view/settings/primaryconfigview.h b/app/view/settings/primaryconfigview.h index 1bf8f945a..d45f20f4f 100644 --- a/app/view/settings/primaryconfigview.h +++ b/app/view/settings/primaryconfigview.h @@ -125,6 +125,7 @@ protected: private slots: void immutabilityChanged(Plasma::Types::ImmutabilityType type); + void updateAvailableScreenGeometry(); void updateEnabledBorders(); void updateShowInlineProperties();