summaryrefslogtreecommitdiff
path: root/kde-plasma/kwin/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-05-30 11:44:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-05-30 11:44:06 +0100
commitf516638b7fe9592837389826a6152a7e1b251c54 (patch)
tree8bfecb640b7b6403d7a3d662d923eed630033da7 /kde-plasma/kwin/files
parent1a61119f9f7b057830e2ce0563f913ec86f282ad (diff)
gentoo resync : 30.05.2020
Diffstat (limited to 'kde-plasma/kwin/files')
-rw-r--r--kde-plasma/kwin/files/kwin-5.18.5-dont-exec-QDialog.patch149
-rw-r--r--kde-plasma/kwin/files/kwin-5.18.5-wayland-lockscreen-greeter.patch73
2 files changed, 222 insertions, 0 deletions
diff --git a/kde-plasma/kwin/files/kwin-5.18.5-dont-exec-QDialog.patch b/kde-plasma/kwin/files/kwin-5.18.5-dont-exec-QDialog.patch
new file mode 100644
index 000000000000..df65c32fb13a
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-5.18.5-dont-exec-QDialog.patch
@@ -0,0 +1,149 @@
+From 5ea54eda5d1f91428933d338ea8b950aea86d43a Mon Sep 17 00:00:00 2001
+From: Kai Uwe Broulik <kde@privat.broulik.de>
+Date: Wed, 6 May 2020 15:15:03 +0200
+Subject: [kcmkwin/kwindecoration] Don't exec() QDialog
+
+Using nested event loops with QML is always troublesome.
+
+BUG: 421053
+FIXED-IN: 5.18.6
+
+Differential Revision: https://phabricator.kde.org/D29473
+---
+ .../declarative-plugin/previewbridge.cpp | 32 +++++++++++++++-------
+ .../declarative-plugin/previewbridge.h | 4 ++-
+ .../kwindecoration/package/contents/ui/Themes.qml | 3 +-
+ 3 files changed, 27 insertions(+), 12 deletions(-)
+
+diff --git a/kcmkwin/kwindecoration/declarative-plugin/previewbridge.cpp b/kcmkwin/kwindecoration/declarative-plugin/previewbridge.cpp
+index bad4cc1..83a9bd9 100644
+--- a/kcmkwin/kwindecoration/declarative-plugin/previewbridge.cpp
++++ b/kcmkwin/kwindecoration/declarative-plugin/previewbridge.cpp
+@@ -36,7 +36,11 @@
+ #include <QDialog>
+ #include <QDialogButtonBox>
+ #include <QPushButton>
++#include <QQuickItem>
++#include <QQuickRenderControl>
++#include <QQuickWindow>
+ #include <QVBoxLayout>
++#include <QWindow>
+
+ namespace KDecoration2
+ {
+@@ -173,15 +177,16 @@ DecorationButton *PreviewBridge::createButton(KDecoration2::Decoration *decorati
+ return m_factory->create<KDecoration2::DecorationButton>(QStringLiteral("button"), parent, QVariantList({QVariant::fromValue(type), QVariant::fromValue(decoration)}));
+ }
+
+-void PreviewBridge::configure()
++void PreviewBridge::configure(QQuickItem *ctx)
+ {
+ if (!m_valid) {
+ return;
+ }
+ //setup the UI
+- QDialog dialog;
++ QDialog *dialog = new QDialog();
++ dialog->setAttribute(Qt::WA_DeleteOnClose);
+ if (m_lastCreatedClient) {
+- dialog.setWindowTitle(m_lastCreatedClient->caption());
++ dialog->setWindowTitle(m_lastCreatedClient->caption());
+ }
+
+ // create the KCModule through the plugintrader
+@@ -189,7 +194,7 @@ void PreviewBridge::configure()
+ if (!m_theme.isNull()) {
+ args.insert(QStringLiteral("theme"), m_theme);
+ }
+- KCModule *kcm = m_factory->create<KCModule>(QStringLiteral("kcmodule"), &dialog, QVariantList({args}));
++ KCModule *kcm = m_factory->create<KCModule>(QStringLiteral("kcmodule"), dialog, QVariantList({args}));
+ if (!kcm) {
+ return;
+ }
+@@ -205,28 +210,35 @@ void PreviewBridge::configure()
+ QStringLiteral("reloadConfig"));
+ QDBusConnection::sessionBus().send(message);
+ };
+- connect(&dialog, &QDialog::accepted, this, save);
++ connect(dialog, &QDialog::accepted, this, save);
+
+ QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok |
+ QDialogButtonBox::Cancel |
+ QDialogButtonBox::RestoreDefaults |
+ QDialogButtonBox::Reset,
+- &dialog);
++ dialog);
+
+ QPushButton *reset = buttons->button(QDialogButtonBox::Reset);
+ reset->setEnabled(false);
+ // Here we connect our buttons with the dialog
+- connect(buttons, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
+- connect(buttons, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
++ connect(buttons, &QDialogButtonBox::accepted, dialog, &QDialog::accept);
++ connect(buttons, &QDialogButtonBox::rejected, dialog, &QDialog::reject);
+ connect(reset, &QPushButton::clicked, kcm, &KCModule::load);
+ auto changedSignal = static_cast<void(KCModule::*)(bool)>(&KCModule::changed);
+ connect(kcm, changedSignal, reset, &QPushButton::setEnabled);
+ connect(buttons->button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, kcm, &KCModule::defaults);
+
+- QVBoxLayout *layout = new QVBoxLayout(&dialog);
++ QVBoxLayout *layout = new QVBoxLayout(dialog);
+ layout->addWidget(kcm);
+ layout->addWidget(buttons);
+- dialog.exec();
++
++ if (ctx->window()) {
++ dialog->winId(); // so it creates windowHandle
++ dialog->windowHandle()->setTransientParent(QQuickRenderControl::renderWindowFor(ctx->window()));
++ dialog->setModal(true);
++ }
++
++ dialog->show();
+ }
+
+ BridgeItem::BridgeItem(QObject *parent)
+diff --git a/kcmkwin/kwindecoration/declarative-plugin/previewbridge.h b/kcmkwin/kwindecoration/declarative-plugin/previewbridge.h
+index 7e1d8f3..85fccbe 100644
+--- a/kcmkwin/kwindecoration/declarative-plugin/previewbridge.h
++++ b/kcmkwin/kwindecoration/declarative-plugin/previewbridge.h
+@@ -26,6 +26,8 @@
+ #include <QList>
+ #include <QPointer>
+
++class QQuickItem;
++
+ class KPluginFactory;
+
+ namespace KDecoration2
+@@ -70,7 +72,7 @@ public:
+ KDecoration2::DecorationButton *createButton(KDecoration2::Decoration *decoration, KDecoration2::DecorationButtonType type, QObject *parent = nullptr);
+
+ public Q_SLOTS:
+- void configure();
++ void configure(QQuickItem *ctx);
+
+ Q_SIGNALS:
+ void pluginChanged();
+diff --git a/kcmkwin/kwindecoration/package/contents/ui/Themes.qml b/kcmkwin/kwindecoration/package/contents/ui/Themes.qml
+index 28e5899..1eeb4cd 100644
+--- a/kcmkwin/kwindecoration/package/contents/ui/Themes.qml
++++ b/kcmkwin/kwindecoration/package/contents/ui/Themes.qml
+@@ -40,6 +40,7 @@ KCM.GridView {
+ view.implicitCellWidth: Kirigami.Units.gridUnit * 18
+
+ view.delegate: KCM.GridDelegate {
++ id: delegate
+ text: model.display
+
+ thumbnailAvailable: true
+@@ -101,7 +102,7 @@ KCM.GridView {
+ onTriggered: {
+ kcm.theme = index
+ view.currentIndex = index
+- bridgeItem.bridge.configure()
++ bridgeItem.bridge.configure(delegate)
+ }
+ }
+ ]
+--
+cgit v1.1
diff --git a/kde-plasma/kwin/files/kwin-5.18.5-wayland-lockscreen-greeter.patch b/kde-plasma/kwin/files/kwin-5.18.5-wayland-lockscreen-greeter.patch
new file mode 100644
index 000000000000..ac4b9d24c8e1
--- /dev/null
+++ b/kde-plasma/kwin/files/kwin-5.18.5-wayland-lockscreen-greeter.patch
@@ -0,0 +1,73 @@
+From 6f8b8efb338117ee197092e46b25b489b612257d Mon Sep 17 00:00:00 2001
+From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
+Date: Fri, 8 May 2020 11:26:27 +0300
+Subject: [wayland] Place lockscreen greeter above other windows
+
+Summary: BUG: 420802
+
+Reviewers: #kwin, davidedmundson
+
+Reviewed By: #kwin, davidedmundson
+
+Subscribers: apol, kwin
+
+Tags: #kwin
+
+Differential Revision: https://phabricator.kde.org/D29523
+---
+ abstract_client.cpp | 2 ++
+ autotests/integration/lockscreen.cpp | 19 +++++++++++++++++++
+ 2 files changed, 21 insertions(+)
+
+diff --git a/abstract_client.cpp b/abstract_client.cpp
+index ca6c422..48918e7 100644
+--- a/abstract_client.cpp
++++ b/abstract_client.cpp
+@@ -275,6 +275,8 @@ Layer AbstractClient::belongsToLayer() const
+ // Since the desktop is also activated, nothing should be in the ActiveLayer, though
+ if (isInternal())
+ return UnmanagedLayer;
++ if (isLockScreen())
++ return UnmanagedLayer;
+ if (isDesktop())
+ return workspace()->showingDesktop() ? AboveLayer : DesktopLayer;
+ if (isSplash()) // no damn annoying splashscreens
+diff --git a/autotests/integration/lockscreen.cpp b/autotests/integration/lockscreen.cpp
+index e258540..82cac09 100644
+--- a/autotests/integration/lockscreen.cpp
++++ b/autotests/integration/lockscreen.cpp
+@@ -62,6 +62,7 @@ private Q_SLOTS:
+ void initTestCase();
+ void init();
+ void cleanup();
++ void testStackingOrder();
+ void testPointer();
+ void testPointerButton();
+ void testPointerAxis();
+@@ -223,6 +224,24 @@ void LockScreenTest::cleanup()
+ Test::destroyWaylandConnection();
+ }
+
++void LockScreenTest::testStackingOrder()
++{
++ // This test verifies that the lockscreen greeter is placed above other windows.
++
++ QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
++ QVERIFY(clientAddedSpy.isValid());
++
++ LOCK
++ QVERIFY(clientAddedSpy.wait());
++
++ AbstractClient *client = clientAddedSpy.first().first().value<AbstractClient *>();
++ QVERIFY(client);
++ QVERIFY(client->isLockScreen());
++ QCOMPARE(client->layer(), UnmanagedLayer);
++
++ UNLOCK
++}
++
+ void LockScreenTest::testPointer()
+ {
+ using namespace KWayland::Client;
+--
+cgit v1.1