summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2018-05-04 17:45:19 -0400
committerRay Strode <rstrode@redhat.com>2018-05-07 10:30:32 -0400
commit554332b92b76d3c481f027ed41d63aeeb090ca69 (patch)
treedc88e7f5b1d5dd3eb5d583751b9190847f0143df
parent853c81eb62c0ab094e7b99fdd78dd57377481e6f (diff)
downloadgnome-shell-wip/halfline/fix-layout-switching.tar.gz
keyboardManager: take group index into account when preserving keymapwip/halfline/fix-layout-switching
commit 642107a2 attempts to avoid resetting the current keymap on spurious input source changes. It does this by checking if the current layout id is found in the new list of layouts and resetting the current layout to the associated match in the list. By not nullifying the current layout, it won't get subsequently reset. Unfortunately, if the order of the list changes, resetting the current keymap is still necessary, since the order corresponds with the index of the activated group. This commit changes the code to nullify the current layout if its group index changes. https://bugzilla.redhat.com/show_bug.cgi?id=1573923
-rw-r--r--js/misc/keyboardManager.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/js/misc/keyboardManager.js b/js/misc/keyboardManager.js
index 3f0bad282..ae59f0014 100644
--- a/js/misc/keyboardManager.js
+++ b/js/misc/keyboardManager.js
@@ -90,6 +90,7 @@ 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 = {};
@@ -116,7 +117,7 @@ var KeyboardManager = new Lang.Class({
info.group = group;
info.groupIndex = groupIndex;
- if (id == currentId)
+ if (currentId == id && currentGroupIndex == groupIndex)
this._current = info;
i += 1;