diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-11-12 10:27:43 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-11-12 10:27:43 +0000 |
commit | f1535b44d6fda761018ea432a180dcb482e97652 (patch) | |
tree | 0c17b546154f9b91340a45d84b5dc42dc12c7713 /kde-plasma/plasma-desktop/files | |
parent | cdc1eda9c1ad611dd737415be2790c8f44812f1c (diff) |
gentoo auto-resync : 12:11:2023 - 10:27:42
Diffstat (limited to 'kde-plasma/plasma-desktop/files')
-rw-r--r-- | kde-plasma/plasma-desktop/files/plasma-desktop-5.27.9-foldermodel-screen-add-remove-handling.patch | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/kde-plasma/plasma-desktop/files/plasma-desktop-5.27.9-foldermodel-screen-add-remove-handling.patch b/kde-plasma/plasma-desktop/files/plasma-desktop-5.27.9-foldermodel-screen-add-remove-handling.patch new file mode 100644 index 000000000000..8d5ad98b40b7 --- /dev/null +++ b/kde-plasma/plasma-desktop/files/plasma-desktop-5.27.9-foldermodel-screen-add-remove-handling.patch @@ -0,0 +1,95 @@ +From a6bc63103ed128ffe0fd843eb3c4416ede835fde Mon Sep 17 00:00:00 2001 +From: Harald Sitter <sitter@kde.org> +Date: Mon, 6 Nov 2023 23:24:57 +0100 +Subject: [PATCH] foldermodel: lift screen add/remove handling out of + screenmapper + +screenmapper is the wrong place for it because we don't know the url +inside the mapper. Instead handle events in the foldermodel and +correctly delegate the add/remove actions to the mapper with both our +screenId AND the activityId + +notably the previous code would incorrectly invoke addScreen with empty +activityIds triggering fallback handling that resulted in incorrect +m_screensPerPath management (there would be no screen associated with +our url anymore after a screenAdded signal because our screen got +associated with no url) and consequently firstAvailableScreen would +return no screen for our url (remember: we are associated with no url) +making FolderModel::filterAcceptsRow return false and filtering +completely valid entries + +BUG: 467951 + +possibly also is the root cause behind +CCBUG: 467092 +--- + containments/desktop/plugins/folder/foldermodel.cpp | 12 +++++++++++- + containments/desktop/plugins/folder/screenmapper.cpp | 9 +-------- + containments/desktop/plugins/folder/screenmapper.h | 2 +- + 3 files changed, 13 insertions(+), 10 deletions(-) + +diff --git a/containments/desktop/plugins/folder/foldermodel.cpp b/containments/desktop/plugins/folder/foldermodel.cpp +index 6a9f8da607..bcab0275e3 100644 +--- a/containments/desktop/plugins/folder/foldermodel.cpp ++++ b/containments/desktop/plugins/folder/foldermodel.cpp +@@ -2024,7 +2024,17 @@ void FolderModel::setAppletInterface(QObject *appletInterface) + Plasma::Corona *corona = containment->corona(); + + if (corona) { +- m_screenMapper->setCorona(corona, m_currentActivity); ++ connect(corona, &Plasma::Corona::screenRemoved, this, [this](int screenId) { ++ if (m_screen == screenId) { ++ m_screenMapper->removeScreen(screenId, m_currentActivity, resolvedUrl()); ++ } ++ }); ++ connect(corona, &Plasma::Corona::screenAdded, this, [this](int screenId) { ++ if (m_screen == screenId) { ++ m_screenMapper->addScreen(screenId, m_currentActivity, resolvedUrl()); ++ } ++ }); ++ m_screenMapper->setCorona(corona); + } + setScreen(containment->screen()); + connect(containment, &Plasma::Containment::screenChanged, this, &FolderModel::setScreen); +diff --git a/containments/desktop/plugins/folder/screenmapper.cpp b/containments/desktop/plugins/folder/screenmapper.cpp +index 83e8a75276..fccea0e3fe 100644 +--- a/containments/desktop/plugins/folder/screenmapper.cpp ++++ b/containments/desktop/plugins/folder/screenmapper.cpp +@@ -243,20 +243,13 @@ void ScreenMapper::cleanup() + } + #endif + +-void ScreenMapper::setCorona(Plasma::Corona *corona, const QString &activity) ++void ScreenMapper::setCorona(Plasma::Corona *corona) + { + if (m_corona != corona) { + Q_ASSERT(!m_corona); + + m_corona = corona; + if (m_corona) { +- connect(m_corona, &Plasma::Corona::screenRemoved, this, [this, activity](int screenId) { +- removeScreen(screenId, activity, {}); +- }); +- connect(m_corona, &Plasma::Corona::screenAdded, this, [this, activity](int screenId) { +- addScreen(screenId, activity, {}); +- }); +- + auto config = m_corona->config(); + KConfigGroup group(config, QStringLiteral("ScreenMapping")); + const QStringList mapping = group.readEntry(QStringLiteral("screenMapping"), QStringList{}); +diff --git a/containments/desktop/plugins/folder/screenmapper.h b/containments/desktop/plugins/folder/screenmapper.h +index 47b01e1c08..c22432b2e8 100644 +--- a/containments/desktop/plugins/folder/screenmapper.h ++++ b/containments/desktop/plugins/folder/screenmapper.h +@@ -50,7 +50,7 @@ public: + int screenForItem(const QUrl &url, const QString &activity) const; + void addMapping(const QUrl &url, int screen, const QString &activity, MappingSignalBehavior behavior = ImmediateSignal); + void removeFromMap(const QUrl &url, const QString &activity); +- void setCorona(Plasma::Corona *corona, const QString &activity); ++ void setCorona(Plasma::Corona *corona); + + void addScreen(int screenId, const QString &activity, const QUrl &screenUrl); + void removeScreen(int screenId, const QString &activity, const QUrl &screenUrl); +-- +GitLab + |