Compare commits

...

2 Commits

Author SHA1 Message Date
Carlos Garnacho
7f66aede01 keyboard: Fix warnings on destroyed actors
Trying to hide a page gets hard when the page was previouly destroyed.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1281
2019-05-10 00:09:23 +02:00
Carlos Garnacho
bd5a1121d6 keyboard: Rename variable to JS style
This variable has been there since the OSK origins, and nothing guaranteed
the need for renaming it. It's enough of an eye sore though.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1281
2019-05-10 00:08:56 +02:00

View File

@ -1162,7 +1162,7 @@ var Keyboard = class Keyboard {
this._keyboardController = new KeyboardController(); this._keyboardController = new KeyboardController();
this._groups = {}; this._groups = {};
this._current_page = null; this._currentPage = null;
this._suggestions = new Suggestions(); this._suggestions = new Suggestions();
this.actor.add(this._suggestions.actor, this.actor.add(this._suggestions.actor,
@ -1355,7 +1355,7 @@ var Keyboard = class Keyboard {
} else if (switchToLevel == 1) { } else if (switchToLevel == 1) {
extraButton.connect('long-press', () => { extraButton.connect('long-press', () => {
this._latched = true; this._latched = true;
this._setCurrentLevelLatched(this._current_page, this._latched); this._setCurrentLevelLatched(this._currentPage, this._latched);
}); });
} }
@ -1382,8 +1382,8 @@ var Keyboard = class Keyboard {
} }
_updateCurrentPageVisible() { _updateCurrentPageVisible() {
if (this._current_page) if (this._currentPage)
this._current_page.visible = !this._emojiActive && !this._keypadVisible; this._currentPage.visible = !this._emojiActive && !this._keypadVisible;
} }
_setEmojiActive(active) { _setEmojiActive(active) {
@ -1442,7 +1442,7 @@ var Keyboard = class Keyboard {
_getGridSlots() { _getGridSlots() {
let numOfHorizSlots = 0, numOfVertSlots; let numOfHorizSlots = 0, numOfVertSlots;
let rows = this._current_page.get_children(); let rows = this._currentPage.get_children();
numOfVertSlots = rows.length; numOfVertSlots = rows.length;
for (let i = 0; i < rows.length; ++i) { for (let i = 0; i < rows.length; ++i) {
@ -1477,6 +1477,7 @@ var Keyboard = class Keyboard {
c.destroy(); c.destroy();
}); });
this._currentPage = null;
this._groups = {}; this._groups = {};
this._onGroupChanged(); this._onGroupChanged();
} }
@ -1520,12 +1521,12 @@ var Keyboard = class Keyboard {
let activeGroupName = this._keyboardController.getCurrentGroup(); let activeGroupName = this._keyboardController.getCurrentGroup();
let layers = this._groups[activeGroupName]; let layers = this._groups[activeGroupName];
if (this._current_page != null) { if (this._currentPage != null) {
this._setCurrentLevelLatched(this._current_page, false); this._setCurrentLevelLatched(this._currentPage, false);
this._current_page.hide(); this._currentPage.hide();
} }
this._current_page = layers[activeLevel]; this._currentPage = layers[activeLevel];
this._updateCurrentPageVisible(); this._updateCurrentPageVisible();
} }