keyboard: Don't try to set the same current page twice

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/540
This commit is contained in:
Marco Trevisan (Treviño) 2019-05-09 14:35:11 -05:00
parent c0c2edf2e1
commit d84bbb8770

View File

@ -1519,6 +1519,12 @@ var Keyboard = class Keyboard {
_setActiveLayer(activeLevel) { _setActiveLayer(activeLevel) {
let activeGroupName = this._keyboardController.getCurrentGroup(); let activeGroupName = this._keyboardController.getCurrentGroup();
let layers = this._groups[activeGroupName]; let layers = this._groups[activeGroupName];
let currentPage = layers[activeLevel];
if (this._current_page == currentPage) {
this._updateCurrentPageVisible();
return;
}
if (this._current_page != null) { if (this._current_page != null) {
this._setCurrentLevelLatched(this._current_page, false); this._setCurrentLevelLatched(this._current_page, false);
@ -1527,7 +1533,7 @@ var Keyboard = class Keyboard {
delete this._current_page._destroyID; delete this._current_page._destroyID;
} }
this._current_page = layers[activeLevel]; this._current_page = currentPage;
this._current_page._destroyID = this._current_page.connect('destroy', () => { this._current_page._destroyID = this._current_page.connect('destroy', () => {
this._current_page = null; this._current_page = null;
}); });