- Add experimental patch to fix some dangling duplicate

containments in the -appletsrc:
  * 0001-better-clean-up-of-duplicate-containments.patch

OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/plasma5-workspace?expand=0&rev=283
This commit is contained in:
2017-01-10 20:43:13 +00:00
committed by Git OBS Bridge
parent ef678fa31f
commit 07f420d1df
3 changed files with 85 additions and 1 deletions

View File

@@ -0,0 +1,74 @@
From b3e531cf5930e33bad023ef13c1d4bf3079eca4e Mon Sep 17 00:00:00 2001
From: Marco Martin <notmart@gmail.com>
Date: Tue, 10 Jan 2017 15:27:14 +0100
Subject: [PATCH] better clean up of duplicate containments
Summary:
due to old multiscreen bugs, sometimes the appletsrc file
gets polluted with a lot of containments with same activity id
and lastScreen, in some cases even hundreds
(see https://bugs.kde.org/show_bug.cgi?id=371858)
in that case we can't be 100% sure what containment will be loaded
at startup, leading to an herratical behavior.
it was trying to clean up duplicates but wasn't really effective
now base upon lastScreen (so we catch other activities as well)
and manually remove the destroyed containment from
m_desktopContainments (which may sole some multiscreen
related bug, such as 371991)
BUG:371858
CCBUG:371991
Test Plan:
started a session with the corrupted appletsrc from the bugreport,
file gets cleaned out of duplicates
Reviewers: davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3981
---
shell/shellcorona.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp
index 4e7dd3e3..e53dd4db 100644
--- a/shell/shellcorona.cpp
+++ b/shell/shellcorona.cpp
@@ -1909,7 +1909,8 @@ void ShellCorona::insertContainment(const QString &activity, int screenNum, Plas
{
Plasma::Containment *cont = nullptr;
for (Plasma::Containment *c : m_desktopContainments.value(activity)) {
- if (c->screen() == screenNum) {
+ //using lastScreen() instead of screen() catches also containments of activities that aren't the current one, so not assigned to a screen right now
+ if (c->lastScreen() == screenNum) {
cont = c;
if (containment == cont) {
return;
@@ -1921,8 +1922,6 @@ void ShellCorona::insertContainment(const QString &activity, int screenNum, Plas
Q_ASSERT(!m_desktopContainments.value(activity).values().contains(containment));
if (cont) {
- disconnect(cont, SIGNAL(destroyed(QObject*)),
- this, SLOT(desktopContainmentDestroyed(QObject*)));
cont->destroy();
}
m_desktopContainments[activity].insert(containment);
@@ -1937,7 +1936,8 @@ void ShellCorona::desktopContainmentDestroyed(QObject *obj)
// members of Containment are not accessible anymore,
// so keep ugly bookeeping by hand
auto containment = static_cast<Plasma::Containment*>(obj);
- for (auto a : m_desktopContainments) {
+ //explicitly specify the range by reference, as we need to remove stuff from the sets
+ for (QSet<Plasma::Containment *> &a : m_desktopContainments) {
QMutableSetIterator<Plasma::Containment *> it(a);
while (it.hasNext()) {
it.next();
--
2.11.0

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Jan 10 20:42:09 UTC 2017 - fabian@ritter-vogt.de
- Add experimental patch to fix some dangling duplicate
containments in the -appletsrc:
* 0001-better-clean-up-of-duplicate-containments.patch
-------------------------------------------------------------------
Tue Dec 27 18:31:45 UTC 2016 - fabian@ritter-vogt.de

View File

@@ -1,7 +1,7 @@
#
# spec file for package plasma5-workspace
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -41,6 +41,8 @@ Patch2: 0001-Ignore-default-sddm-face-icons.patch
# PATCH-FIX-OPENSUSE add-tray-icon-cache.patch kde#356479 fabian@ritter-vogt.de -- Workaround for high load due to animated tray icons
Patch3: add-tray-icon-cache.patch
# PATCHES 100-200 and above are from upstream 5.8 branch
# PATCH-FIX-UPSTREAM 0001-better-clean-up-of-duplicate-containments.patch kde#371858 notmart@gmail.com -- better clean up of duplicate containments
Patch100: 0001-better-clean-up-of-duplicate-containments.patch
# PATCHES 201-300 and above are from upstream master/5.9 branch
BuildRequires: breeze5-icons
BuildRequires: fdupes
@@ -211,6 +213,7 @@ workspace. Development files.
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch100 -p1
%build
%cmake_kf5 -d build -- -DKDE4_COMMON_PAM_SERVICE=xdm -DKDE_DEFAULT_HOME=.kde4 -DCMAKE_INSTALL_LOCALEDIR=%{_kf5_localedir}