From f45a6d93c09fb4ec5af761dbb6cba4810c8fff2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 23 Oct 2018 11:51:12 +0200 Subject: [PATCH] Backport keyboard layout change fixes Resolves: #1637418 --- ...Avoid-idempotent-calls-to-meta_backe.patch | 68 +++++++++++++++++++ gnome-shell.spec | 8 ++- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 0001-keyboardManager-Avoid-idempotent-calls-to-meta_backe.patch diff --git a/0001-keyboardManager-Avoid-idempotent-calls-to-meta_backe.patch b/0001-keyboardManager-Avoid-idempotent-calls-to-meta_backe.patch new file mode 100644 index 0000000..16d6306 --- /dev/null +++ b/0001-keyboardManager-Avoid-idempotent-calls-to-meta_backe.patch @@ -0,0 +1,68 @@ +From ccc59673827f9e36b7374fcf03de94d1b1513550 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Mon, 22 Oct 2018 22:06:36 +0000 +Subject: [PATCH] keyboardManager: Avoid idempotent calls to + meta_backend_set_keymap() + +But still try to apply the keymap whenever the input sources changed. This +is a different approach to gnome-shell#240 that still avoid redundant +changes to the current keymap, but actually trigger one when input sources +are added. + +https://bugzilla.redhat.com/show_bug.cgi?id=1637418 + +Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/691 + + +(cherry picked from commit b405ed64427a9d518d1714df678d04ad11267e15) +--- + js/misc/keyboardManager.js | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/js/misc/keyboardManager.js b/js/misc/keyboardManager.js +index ae59f0014..f4001f130 100644 +--- a/js/misc/keyboardManager.js ++++ b/js/misc/keyboardManager.js +@@ -52,11 +52,20 @@ var KeyboardManager = new Lang.Class({ + this._current = null; + this._localeLayoutInfo = this._getLocaleLayout(); + this._layoutInfos = {}; ++ this._currentKeymap = null; + }, + + _applyLayoutGroup(group) { + let options = this._buildOptionsString(); + let [layouts, variants] = this._buildGroupStrings(group); ++ ++ if (this._currentKeymap && ++ this._currentKeymap.layouts == layouts && ++ this._currentKeymap.variants == variants && ++ this._currentKeymap.options == options) ++ return; ++ ++ this._currentKeymap = {layouts, variants, options}; + Meta.get_backend().set_keymap(layouts, variants, options); + }, + +@@ -89,8 +98,6 @@ var KeyboardManager = new Lang.Class({ + }, + + setUserLayouts(ids) { +- let currentId = this._current ? this._current.id : null; +- let currentGroupIndex = this._current ? this._current.groupIndex : null; + this._current = null; + this._layoutInfos = {}; + +@@ -117,9 +124,6 @@ var KeyboardManager = new Lang.Class({ + info.group = group; + info.groupIndex = groupIndex; + +- if (currentId == id && currentGroupIndex == groupIndex) +- this._current = info; +- + i += 1; + } + }, +-- +2.19.1 + diff --git a/gnome-shell.spec b/gnome-shell.spec index 1dc5c82..d7f2eb6 100644 --- a/gnome-shell.spec +++ b/gnome-shell.spec @@ -1,6 +1,6 @@ Name: gnome-shell Version: 3.30.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Window management and application launching for GNOME Group: User Interface/Desktops @@ -18,6 +18,9 @@ Patch1: gnome-shell-favourite-apps-firefox.patch Patch2: 0001-endSessionDialog-Immediately-add-buttons-to-the-dial.patch Patch3: 0002-endSessionDialog-Support-rebooting-into-the-bootload.patch +# Backport keyboard layout change fixes (rhbz#1637418) +Patch4: 0001-keyboardManager-Avoid-idempotent-calls-to-meta_backe.patch + %define libcroco_version 0.6.8 %define eds_version 3.17.2 %define gnome_desktop_version 3.7.90 @@ -214,6 +217,9 @@ glib-compile-schemas --allow-any-name %{_datadir}/glib-2.0/schemas &> /dev/null %{_mandir}/man1/%{name}.1.gz %changelog +* Tue Oct 23 2018 Jonas Ådahl - 3.30.1-2 +- Backport keyboard layout change fixes (rhbz#1637418) + * Mon Oct 08 2018 Florian Müllner - 3.30.1-1 - Update to 3.30.1