Accepting request 440077 from KDE:Frameworks5

1

OBS-URL: https://build.opensuse.org/request/show/440077
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/plasma5-workspace?expand=0&rev=52
This commit is contained in:
Dominique Leuenberger 2016-11-14 19:09:31 +00:00 committed by Git OBS Bridge
commit 631c2f822b
8 changed files with 408 additions and 0 deletions

View File

@ -0,0 +1,37 @@
From 6995ba91368aafdb79f49eee379bd7c8ed79b671 Mon Sep 17 00:00:00 2001
From: Kai Uwe Broulik <kde@privat.broulik.de>
Date: Tue, 8 Nov 2016 15:14:33 +0100
Subject: [PATCH 1/5] [taskmanagerrulesrc] Add Rewrite Rule for Google-chrome
Google Chrome needlessly changed its window class class to Google-chrome
(was google-chrome previously) breaking our launcher mapping.
BUG: 372211
FIXED-IN: 5.8.4
Differential Revision: https://phabricator.kde.org/D3308
---
libtaskmanager/taskmanagerrulesrc | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/libtaskmanager/taskmanagerrulesrc b/libtaskmanager/taskmanagerrulesrc
index 56ff05b..915f99f 100644
--- a/libtaskmanager/taskmanagerrulesrc
+++ b/libtaskmanager/taskmanagerrulesrc
@@ -22,6 +22,13 @@ Identifier=DesktopEntryName
Match=(?<=crx_)(?'match'[a-z]+)
Target=chrome-%1-default
+# Google changed the class to be "Google-chrome" around version 54
+[Rewrite Rules][Google-chrome][1]
+Property=ClassName
+Identifier=DesktopEntryName
+Match=(?<=crx_)(?'match'[a-z]+)
+Target=chrome-%1-default
+
[Rewrite Rules][chromium][1]
Property=ClassName
Identifier=DesktopEntryName
--
2.10.1

View File

@ -0,0 +1,76 @@
From c89560cb534692ac9344533a207216e219de60d1 Mon Sep 17 00:00:00 2001
From: Marco Martin <notmart@gmail.com>
Date: Wed, 9 Nov 2016 15:54:42 +0100
Subject: [PATCH 2/5] make sure all outputs are known
at startup, if a screen id is missing from the screenpool mapping
containment::screen() will return -1 for a moment in the startup
phase even if it has a valid lastScreen
populate mappings of eventual missing stuff at screenpool ctor
make sure destroyed containments don't get assigned a view
reviewed-by: David Edmundson
CCBUG:372099
CCBUG:371858
CCBUG:371991
CCBUG:371819
CCBUG:371734
---
shell/screenpool.cpp | 11 +++++++++++
shell/shellcorona.cpp | 8 +++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/shell/screenpool.cpp b/shell/screenpool.cpp
index 89868e8..011300d 100644
--- a/shell/screenpool.cpp
+++ b/shell/screenpool.cpp
@@ -51,6 +51,17 @@ ScreenPool::ScreenPool(KSharedConfig::Ptr config, QObject *parent)
m_configGroup.deleteEntry(key);
}
}
+
+ // if there are already connected unknown screens, map those
+ // all needs to be populated as soon as possible, otherwise
+ // containment->screen() will return an incorrect -1
+ // at startup, if it' asked before corona::addOutput()
+ // is performed, driving to the creation of a new containment
+ for (QScreen* screen : qGuiApp->screens()) {
+ if (!m_idForConnector.contains(screen->name())) {
+ insertScreenMapping(firstAvailableId(), screen->name());
+ }
+ }
}
ScreenPool::~ScreenPool()
diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp
index 33259da..8189eed 100644
--- a/shell/shellcorona.cpp
+++ b/shell/shellcorona.cpp
@@ -1154,7 +1154,12 @@ Plasma::Containment *ShellCorona::createContainmentForActivity(const QString& ac
{
if (m_desktopContainments.contains(activity)) {
for (Plasma::Containment *cont : m_desktopContainments.value(activity)) {
- if (cont->screen() == screenNum && cont->activity() == activity) {
+ //in the case of a corrupt config file
+ //with multiple containments with same lastScreen
+ //it can happen two insertContainment happen for
+ //the same screen, leading to the old containment
+ //to be destroyed
+ if (!cont->destroyed() && cont->screen() == screenNum && cont->activity() == activity) {
return cont;
}
}
@@ -1808,6 +1813,7 @@ int ShellCorona::screenForContainment(const Plasma::Containment *containment) co
// qDebug() << "ShellCorona screenForContainment: " << containment << " Last screen is " << containment->lastScreen();
for (auto screen : qGuiApp->screens()) {
+ // containment->lastScreen() == m_screenPool->id(screen->name()) to check if the lastScreen refers to a screen that exists/it's known
if (containment->lastScreen() == m_screenPool->id(screen->name()) &&
(containment->activity() == m_activityController->currentActivity() ||
containment->containmentType() == Plasma::Types::PanelContainment || containment->containmentType() == Plasma::Types::CustomPanelContainment)) {
--
2.10.1

View File

@ -0,0 +1,26 @@
From 8ddb7ff40ea8027a1a355b67e4e4e2d57bd28abe Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Wed, 9 Nov 2016 15:11:52 +0000
Subject: [PATCH 3/5] Sync app config in sync with applets config
---
shell/shellcorona.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp
index 8189eed..2e6dda7 100644
--- a/shell/shellcorona.cpp
+++ b/shell/shellcorona.cpp
@@ -114,6 +114,9 @@ ShellCorona::ShellCorona(QObject *parent)
m_appConfigSyncTimer.setSingleShot(true);
m_appConfigSyncTimer.setInterval(s_configSyncDelay);
connect(&m_appConfigSyncTimer, &QTimer::timeout, this, &ShellCorona::syncAppConfig);
+ //we want our application config with screen mapping to always be in sync with the applets one, so a crash at any time will still
+ //leave containments pointing to the correct screens
+ connect(this, &Corona::configSynced, this, &ShellCorona::syncAppConfig);
m_waitingPanelsTimer.setSingleShot(true);
m_waitingPanelsTimer.setInterval(250);
--
2.10.1

View File

@ -0,0 +1,49 @@
From 6248a975791a71465f06e8e403fcf5326326958d Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Thu, 10 Nov 2016 10:28:16 +0000
Subject: [PATCH 4/5] Avoid connecting to screen changed signals twice
Summary:
load() can be called multiple times; either from setShell or
loadLookAndFeelDefaultLayout. We still only want addOutput once when a
screen is added
Reviewers: #plasma, apol
Reviewed By: apol
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3320
CCBUG:372099
CCBUG:371858
CBUG:371991
CCBUG:371819
CCBUG:371734
---
shell/shellcorona.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp
index 2e6dda7..0e926dd 100644
--- a/shell/shellcorona.cpp
+++ b/shell/shellcorona.cpp
@@ -675,9 +675,9 @@ void ShellCorona::load()
addOutput(screen);
}
}
- connect(qGuiApp, &QGuiApplication::screenAdded, this, &ShellCorona::addOutput);
- connect(qGuiApp, &QGuiApplication::primaryScreenChanged, this, &ShellCorona::primaryOutputChanged);
- connect(qGuiApp, &QGuiApplication::screenRemoved, this, &ShellCorona::screenRemoved);
+ connect(qGuiApp, &QGuiApplication::screenAdded, this, &ShellCorona::addOutput, Qt::UniqueConnection);
+ connect(qGuiApp, &QGuiApplication::primaryScreenChanged, this, &ShellCorona::primaryOutputChanged, Qt::UniqueConnection);
+ connect(qGuiApp, &QGuiApplication::screenRemoved, this, &ShellCorona::screenRemoved, Qt::UniqueConnection);
if (!m_waitingPanels.isEmpty()) {
m_waitingPanelsTimer.start();
--
2.10.1

View File

@ -0,0 +1,104 @@
From 38eb3766279bbd5e1faab5295f8e49cdd4b3317f Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Thu, 10 Nov 2016 10:29:27 +0000
Subject: [PATCH 5/5] Load screenpool at the same time as we connect to
screenchanged signals
Summary:
Otherwise we have a gap during load (waiting querying kactivities))
between screen pool being created and us connecting to the screen
changed signals, which in turn are used to update screen pool.
In particular the primary screen can get out of sync between the current
state and the screen pool.
Test Plan: Based on Christopher Feck's research and initial patch
Reviewers: #plasma
Subscribers: mart, rwooninck, fvogt, cfeck, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3319
CCBUG:372099
CCBUG:371858
CBUG:371991
CCBUG:371819
CCBUG:371734
---
shell/autotests/screenpooltest.cpp | 1 +
shell/screenpool.cpp | 8 ++++++++
shell/screenpool.h | 1 +
shell/shellcorona.cpp | 4 +++-
4 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/shell/autotests/screenpooltest.cpp b/shell/autotests/screenpooltest.cpp
index 5d0522f..5fc844a 100644
--- a/shell/autotests/screenpooltest.cpp
+++ b/shell/autotests/screenpooltest.cpp
@@ -51,6 +51,7 @@ void ScreenPoolTest::initTestCase()
cg.deleteGroup();
cg.sync();
m_screenPool = new ScreenPool(KSharedConfig::openConfig(), this);
+ m_screenPool->load();
}
void ScreenPoolTest::cleanupTestCase()
diff --git a/shell/screenpool.cpp b/shell/screenpool.cpp
index 011300d..b60cca1 100644
--- a/shell/screenpool.cpp
+++ b/shell/screenpool.cpp
@@ -30,6 +30,14 @@ ScreenPool::ScreenPool(KSharedConfig::Ptr config, QObject *parent)
connect(&m_configSaveTimer, &QTimer::timeout, this, [this](){
m_configGroup.sync();
});
+}
+
+void ScreenPool::load()
+{
+ m_primaryConnector = QString();
+ m_connectorForId.clear();
+ m_idForConnector.clear();
+
QScreen *primary = qGuiApp->primaryScreen();
if (primary) {
m_primaryConnector = primary->name();
diff --git a/shell/screenpool.h b/shell/screenpool.h
index 046d18b..9b3a9af 100644
--- a/shell/screenpool.h
+++ b/shell/screenpool.h
@@ -33,6 +33,7 @@ class ScreenPool : public QObject {
public:
ScreenPool(KSharedConfig::Ptr config, QObject *parent = nullptr);
+ void load();
~ScreenPool() override;
QString primaryConnector() const;
diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp
index 0e926dd..0cab1b7 100644
--- a/shell/shellcorona.cpp
+++ b/shell/shellcorona.cpp
@@ -627,6 +627,8 @@ void ShellCorona::load()
disconnect(m_activityController, &KActivities::Controller::serviceStatusChanged, this, &ShellCorona::load);
+ m_screenPool->load();
+
//TODO: a kconf_update script is needed
QString configFileName(QStringLiteral("plasma-") + m_shell + QStringLiteral("-appletsrc"));
@@ -1160,7 +1162,7 @@ Plasma::Containment *ShellCorona::createContainmentForActivity(const QString& ac
//in the case of a corrupt config file
//with multiple containments with same lastScreen
//it can happen two insertContainment happen for
- //the same screen, leading to the old containment
+ //the same screen, leading to the old containment
//to be destroyed
if (!cont->destroyed() && cont->screen() == screenNum && cont->activity() == activity) {
return cont;
--
2.10.1

View File

@ -0,0 +1,80 @@
From: Aleix Pol <aleixpol@kde.org>
Date: Mon, 31 Oct 2016 11:06:30 +0000
Subject: Make sure we're looking both for json and desktop metadata
X-Git-Url: http://quickgit.kde.org/?p=plasma-workspace.git&a=commitdiff&h=bfb91f9de153d53a30d82ad6ce0d6732da4ab367
---
Make sure we're looking both for json and desktop metadata
We shouldn't assume metadata is in metadata.desktop
REVIEW: 129276
---
--- a/shell/containmentconfigview.cpp
+++ b/shell/containmentconfigview.cpp
@@ -141,8 +141,8 @@
QStringList packages;
foreach (const QString &sdir, dir.entryList(QDir::AllDirs | QDir::Readable)) {
- QString metadata = dirPath + '/' + sdir + "/metadata.desktop";
- if (QFile::exists(metadata)) {
+ const QString metadata = dirPath + '/' + sdir;
+ if (QFile::exists(metadata + "/metadata.json") || QFile::exists(metadata + "/metadata.desktop")) {
packages << sdir;
}
}
--- a/shell/scripting/scriptengine_v1.cpp
+++ b/shell/scripting/scriptengine_v1.cpp
@@ -510,6 +510,11 @@
if (sc) {
const QString overridePackagePath = sc->lookAndFeelPackage().path() + QStringLiteral("contents/layouts/") + pluginData.pluginId();
+ path = overridePackagePath + QStringLiteral("/metadata.json");
+ if (QFile::exists(path)) {
+ package.setPath(overridePackagePath);
+ }
+
path = overridePackagePath + QStringLiteral("/metadata.desktop");
if (QFile::exists(path)) {
package.setPath(overridePackagePath);
@@ -518,7 +523,10 @@
}
if (!package.isValid()) {
- path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, package.defaultPackageRoot() + pluginData.pluginId() + "/metadata.desktop");
+ path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, package.defaultPackageRoot() + pluginData.pluginId() + "/metadata.json");
+ if (path.isEmpty()) {
+ path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, package.defaultPackageRoot() + pluginData.pluginId() + "/metadata.desktop");
+ }
if (path.isEmpty()) {
// qDebug() << "script path is empty";
return false;
--- a/wallpapers/image/backgroundlistmodel.cpp
+++ b/wallpapers/image/backgroundlistmodel.cpp
@@ -559,7 +559,7 @@
}
const QString filePath = wp.filePath();
- if (QFile::exists(filePath + QString::fromLatin1("/metadata.desktop"))) {
+ if (QFile::exists(filePath + QString::fromLatin1("/metadata.desktop")) || QFile::exists(filePath + QString::fromLatin1("/metadata.json"))) {
package.setPath(filePath);
if (package.isValid()) {
if (!package.filePath("images").isEmpty()) {
--- a/wallpapers/image/image.cpp
+++ b/wallpapers/image/image.cpp
@@ -453,7 +453,9 @@
}
} else {
//if it's not an absolute path, check if it's just a wallpaper name
- const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("wallpapers/") + QString(m_wallpaper + QString::fromLatin1("/metadata.desktop")));
+ QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("wallpapers/") + QString(m_wallpaper + QString::fromLatin1("/metadata.json")));
+ if (path.isEmpty())
+ path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("wallpapers/") + QString(m_wallpaper + QString::fromLatin1("/metadata.desktop")));
if (!path.isEmpty()) {
QDir dir(path);

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Sat Nov 12 21:03:18 UTC 2016 - wbauer@tmo.at
- Add Look-for-both-json-and-desktop-metadata.patch to fix adding a
panel or plasmoid with the new json metadata files
-------------------------------------------------------------------
Thu Nov 10 12:12:45 UTC 2016 - fabian@ritter-vogt.de
- Backport several commits for better multiscreen handling:
* 0001-taskmanagerrulesrc-Add-Rewrite-Rule-for-Google-chrom.patch
* 0002-make-sure-all-outputs-are-known.patch
* 0003-Sync-app-config-in-sync-with-applets-config.patch
* 0004-Avoid-connecting-to-screen-changed-signals-twice.patch
* 0005-Load-screenpool-at-the-same-time-as-we-connect-to-sc.patch
* kde#372099,kde#371858,kde#371991,kde#371819,kde#371734
* boo#1003438
-------------------------------------------------------------------
Thu Nov 3 17:41:27 UTC 2016 - fabian@ritter-vogt.de

View File

@ -45,6 +45,18 @@ Patch3: add-tray-icon-cache.patch
Patch100: keep-wallpaper-aspect-ratio-wallpaper-on-screen-resolution-change.diff
# PATCH-FIX-UPSTREAM use-nearest-aspect-ratio-available-wallpaper.diff alarrosa@suse.com -- New distance algorithm to simplify and improve the wallpaper selection
Patch101: use-nearest-aspect-ratio-available-wallpaper.diff
# PATCH-FIX-UPSTREAM 0001-taskmanagerrulesrc-Add-Rewrite-Rule-for-Google-chrom.patch kde@privat.broulik.de -- [taskmanagerrulesrc] Add Rewrite Rule for Google-chrome
Patch102: 0001-taskmanagerrulesrc-Add-Rewrite-Rule-for-Google-chrom.patch
# PATCH-FIX-UPSTREAM 0002-make-sure-all-outputs-are-known.patch notmart@gmail.com -- make sure all outputs are known
Patch103: 0002-make-sure-all-outputs-are-known.patch
# PATCH-FIX-UPSTREAM 0003-Sync-app-config-in-sync-with-applets-config.patch kde@davidedmundson.co.uk -- Sync app config in sync with applets config
Patch104: 0003-Sync-app-config-in-sync-with-applets-config.patch
# PATCH-FIX-UPSTREAM 0004-Avoid-connecting-to-screen-changed-signals-twice.patch kde@davidedmundson.co.uk -- Avoid connecting to screen changed signals twice
Patch105: 0004-Avoid-connecting-to-screen-changed-signals-twice.patch
# PATCH-FIX-UPSTREAM 0005-Load-screenpool-at-the-same-time-as-we-connect-to-sc.patch kde@davidedmundson.co.uk -- Load screenpool at the same time as we connect to screenchanged signals
Patch106: 0005-Load-screenpool-at-the-same-time-as-we-connect-to-sc.patch
# PATCH-FIX-UPSTREAM Look-for-both-json-and-desktop-metadata.patch -- Fix adding a panel with the new json metadata files
Patch107: Look-for-both-json-and-desktop-metadata.patch
# PATCHES 201-300 and above are from upstream master/5.9 branch
BuildRequires: breeze5-icons
BuildRequires: fdupes
@ -217,6 +229,12 @@ workspace. Development files.
%patch3 -p1
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
%patch107 -p1
%build
%cmake_kf5 -d build -- -DKDE4_COMMON_PAM_SERVICE=xdm -DKDE_DEFAULT_HOME=.kde4 -DCMAKE_INSTALL_LOCALEDIR=%{_kf5_localedir}