diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2023-11-11 17:32:10 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2023-11-12 10:18:13 +0100 |
commit | eaf0f401e8941f9444f428a758491537a16ac3f0 (patch) | |
tree | d32ad30c42863897c6604db270ddbf3b02c800cf /kde-plasma/plasma-desktop/files | |
parent | sys-libs/zlib: Stabilize 1.3-r1 amd64, #917238 (diff) | |
download | gentoo-eaf0f401e8941f9444f428a758491537a16ac3f0.tar.gz gentoo-eaf0f401e8941f9444f428a758491537a16ac3f0.tar.bz2 gentoo-eaf0f401e8941f9444f428a758491537a16ac3f0.zip |
kde-plasma/plasma-desktop: foldermodel: lift screen add/remove handling
... out of screenmapper.
- KDE-bug: https://bugs.kde.org/show_bug.cgi?id=467951
- KDE-bug: https://bugs.kde.org/show_bug.cgi?id=467092
Respin override-include-dirs-3 tarball, updating libinput header.
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
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 + |