keyboard: Hide keyboardBox after destroying the keyboard

It seems there is a weird race condition between Clutter trying to
destroy the keyboard actor and Clutter trying to hide the keyboardBox
container actor: If the keyboardBox is hidden before destroying the
keyboard actor, Clutter doesn't repaint anything and the keyboard
remains visible until something else draws over it.

To fix this issue until we find the underlying Clutter bug, simply
destroy the keyboard actor before hiding the keyboardBox. The order in
which we call these doesn't matter anyway since hideKeyboard(true) hides
the keyboard immediately without an animation.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1736

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1142
This commit is contained in:
Jonas Dreßler 2020-03-28 14:36:20 +01:00 committed by Florian Müllner
parent b68fb35783
commit 867587ef4c

View File

@ -1149,9 +1149,9 @@ var KeyboardManager = class KeyBoardManager {
this._keyboard = new Keyboard(); this._keyboard = new Keyboard();
} else if (!enabled && this._keyboard) { } else if (!enabled && this._keyboard) {
this._keyboard.setCursorLocation(null); this._keyboard.setCursorLocation(null);
Main.layoutManager.hideKeyboard(true);
this._keyboard.destroy(); this._keyboard.destroy();
this._keyboard = null; this._keyboard = null;
Main.layoutManager.hideKeyboard(true);
} }
} }