From 11366f81619e4bdf146b8f57606d133f4db98707 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Sun, 29 Apr 2018 15:19:42 -0700 Subject: [PATCH] Backport fix for password entry modifier key issues (#1569211) --- ...Preserve-current-keymap-across-reloa.patch | 52 +++++++++++++++++++ gnome-shell.spec | 10 +++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 0001-keyboardManager-Preserve-current-keymap-across-reloa.patch diff --git a/0001-keyboardManager-Preserve-current-keymap-across-reloa.patch b/0001-keyboardManager-Preserve-current-keymap-across-reloa.patch new file mode 100644 index 0000000..978680b --- /dev/null +++ b/0001-keyboardManager-Preserve-current-keymap-across-reloa.patch @@ -0,0 +1,52 @@ +From 642107a28f9616b5836d6da3b57d9bfc33acc8d0 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Sun, 29 Apr 2018 16:28:04 +0200 +Subject: [PATCH] keyboardManager: Preserve current keymap across reloads + +The IM can pretty much update the input sources anytime (even if +to set the same ones). That ends up triggering rebuilding all user +defined keymaps, and losing modifier state if we are unfortunate +enough that this caught us while pressing one. + +One common situation seems to be password entries, resulting in +the wrong character being printed if the first character happens +to require the shift key. + +If the current keymap is not found in the newly loaded list, +this._current will end up null, with the same behavior as we get +currently (immediate keymap reload). + +https://bugzilla.redhat.com/show_bug.cgi?id=1569211 + +https://gitlab.gnome.org/GNOME/gnome-shell/issues/240 + +Closes: #240 +--- + js/misc/keyboardManager.js | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/js/misc/keyboardManager.js b/js/misc/keyboardManager.js +index b8984fe98..3f0bad282 100644 +--- a/js/misc/keyboardManager.js ++++ b/js/misc/keyboardManager.js +@@ -89,6 +89,7 @@ var KeyboardManager = new Lang.Class({ + }, + + setUserLayouts(ids) { ++ let currentId = this._current ? this._current.id : null; + this._current = null; + this._layoutInfos = {}; + +@@ -115,6 +116,9 @@ var KeyboardManager = new Lang.Class({ + info.group = group; + info.groupIndex = groupIndex; + ++ if (id == currentId) ++ this._current = info; ++ + i += 1; + } + }, +-- +2.17.0 + diff --git a/gnome-shell.spec b/gnome-shell.spec index 0cd9352..be0a5b5 100644 --- a/gnome-shell.spec +++ b/gnome-shell.spec @@ -1,6 +1,6 @@ Name: gnome-shell Version: 3.29.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Window management and application launching for GNOME Group: User Interface/Desktops @@ -13,6 +13,10 @@ Source0: http://download.gnome.org/sources/gnome-shell/3.29/%{name}-%{ver # Replace Epiphany with Firefox in the default favourite apps list Patch1: gnome-shell-favourite-apps-firefox.patch +# Fix problems when first character in password entry uses a modifier +# key - GGO#240, RHBZ #1569211, backported from upstream master +Patch2: 0001-keyboardManager-Preserve-current-keymap-across-reloa.patch + %define gnome_bluetooth_version 1:3.9.0 %define gobject_introspection_version 1.45.4 %define gjs_version 1.51.90 @@ -119,6 +123,7 @@ easy to use experience. %prep %setup -q %patch1 -p1 -b .firefox +%patch2 -p1 -b .preserve-keymap %build %meson @@ -184,6 +189,9 @@ glib-compile-schemas --allow-any-name %{_datadir}/glib-2.0/schemas &> /dev/null %{_mandir}/man1/%{name}.1.gz %changelog +* Sun Apr 29 2018 Adam Williamson - 3.29.1-2 +- Backport fix for password entry modifier key issues (#1569211) + * Wed Apr 25 2018 Florian Müllner - 3.29.1-1 - Update to 3.29.1