From 53d6a39c5dd38a6c9639291479eb5370f14fb8c6 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 22 Mar 2023 14:37:10 -0700 Subject: [PATCH] Backport MR #2767 to fix slow startup issue (#2179998) --- 2767.patch | 51 +++++++++++++++++++++++++++++++++++++++++++ plasma-workspace.spec | 9 +++++++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 2767.patch diff --git a/2767.patch b/2767.patch new file mode 100644 index 0000000..5192650 --- /dev/null +++ b/2767.patch @@ -0,0 +1,51 @@ +From 8cbc16f0925c75b569c39184a68595c54278e75a Mon Sep 17 00:00:00 2001 +From: ivan tkachenko +Date: Wed, 22 Mar 2023 22:30:44 +0600 +Subject: [PATCH] sddm-theme: Populate keyboard layouts menu only on first show + +Doing it synchronously can be very slow; seemingly scaling with the +number of items in the model. + +https://bugzilla.redhat.com/show_bug.cgi?id=2179998 +--- + lookandfeel/sddm-theme/KeyboardButton.qml | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/lookandfeel/sddm-theme/KeyboardButton.qml b/lookandfeel/sddm-theme/KeyboardButton.qml +index df8767dda4..ca2458b6d2 100644 +--- a/lookandfeel/sddm-theme/KeyboardButton.qml ++++ b/lookandfeel/sddm-theme/KeyboardButton.qml +@@ -17,7 +17,7 @@ PlasmaComponents.ToolButton { + onCurrentIndexChanged: keyboard.currentLayout = currentIndex + + text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Keyboard Layout: %1", keyboard.layouts[currentIndex].longName) +- visible: menu.count > 1 ++ visible: keyboard.layouts.length > 1 + + checkable: true + checked: menu.opened +@@ -36,13 +36,17 @@ PlasmaComponents.ToolButton { + PlasmaCore.ColorScope.colorGroup: PlasmaCore.Theme.NormalColorGroup + PlasmaCore.ColorScope.inherit: false + +- Instantiator { +- id: instantiator +- model: { ++ onAboutToShow: { ++ if (instantiator.model === null) { + let layouts = keyboard.layouts; + layouts.sort((a, b) => a.longName.localeCompare(b.longName)); +- return layouts; ++ instantiator.model = layouts; + } ++ } ++ ++ Instantiator { ++ id: instantiator ++ model: null + onObjectAdded: menu.insertItem(index, object) + onObjectRemoved: menu.removeItem(object) + delegate: PlasmaComponents.MenuItem { +-- +GitLab + diff --git a/plasma-workspace.spec b/plasma-workspace.spec index 50e2d3b..50594d0 100644 --- a/plasma-workspace.spec +++ b/plasma-workspace.spec @@ -28,7 +28,7 @@ Name: plasma-workspace Summary: Plasma workspace, applications and applets Version: 5.27.3 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ URL: https://invent.kde.org/plasma/%{name} @@ -63,6 +63,10 @@ Source40: ssh-agent.conf Source41: spice-vdagent.conf ## upstream Patches (master branch) +# https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2767 +# https://bugzilla.redhat.com/show_bug.cgi?id=2179998 +# Fix delay on startup caused by populating keyboard layout list +Patch0: 2767.patch ## upstreamable Patches @@ -792,6 +796,9 @@ fi %changelog +* Wed Mar 22 2023 Adam Williamson - 5.27.3-2 +- Backport MR #2767 to fix slow startup issue (#2179998) + * Tue Mar 14 2023 Marc Deop i Argemí - 5.27.3-1 - 5.27.3