From 4c1c65e353e87f53f5affc0358b7228c50956aab Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 3 Jan 2022 20:45:05 +0200 Subject: [PATCH] scrgeometries:public empty QRegion() correctly --- app/plasma/extended/screengeometries.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/plasma/extended/screengeometries.cpp b/app/plasma/extended/screengeometries.cpp index 4fbaae68d..daf11b392 100644 --- a/app/plasma/extended/screengeometries.cpp +++ b/app/plasma/extended/screengeometries.cpp @@ -139,15 +139,16 @@ void ScreenGeometries::setPlasmaAvailableScreenRegion(const QString &screenName, QVariant regionvariant; + QList rects; if (!region.isNull()) { //! transorm QRegion to QList in order to be sent through dbus - QList rects; foreach (const QRect &rect, region) { rects << rect; } - - regionvariant = QVariant::fromValue(rects); + } else { + rects << QRect(); } + regionvariant = QVariant::fromValue(rects); QVariantList args; @@ -238,14 +239,21 @@ void ScreenGeometries::updateGeometries() //! check for inactive screens that were published previously for (QString &lastScrName : m_lastScreenNames) { - if (!screenIsActive(lastScrName) || clearedScreenNames.contains(lastScrName)) { + bool scractive = screenIsActive(lastScrName); + + if (!scractive || clearedScreenNames.contains(lastScrName)) { //! screen became inactive and its geometries could be unpublished setPlasmaAvailableScreenRect(lastScrName, QRect()); setPlasmaAvailableScreenRegion(lastScrName, QRegion()); m_lastAvailableRect.remove(lastScrName); m_lastAvailableRegion.remove(lastScrName); + } + + if (!scractive) { qDebug() << " PLASMA SCREEN GEOMETRIES, INACTIVE SCREEN :: " << lastScrName; + } else if (clearedScreenNames.contains(lastScrName)) { + qDebug() << " PLASMA SCREEN GEOMETRIES, CLEARED SCREEN :: " << lastScrName; } }