From 2cf8b93a7b0da5280f26223ccd52388388f46491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Sat, 20 Feb 2021 12:35:06 +0100 Subject: [PATCH] keyboard: Allow closing immediately Just like opening the OSK, make it possible to close it immediately, we'll make use of this in the next commit. Part-of: --- js/ui/keyboard.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 023b0484f..22ebb3265 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1798,7 +1798,7 @@ var Keyboard = GObject.registerClass({ this._setEmojiActive(false); } - close() { + close(immediate = false) { this._clearShowIdle(); this._keyboardRequested = false; @@ -1806,6 +1806,12 @@ var Keyboard = GObject.registerClass({ return; this._clearKeyboardRestTimer(); + + if (immediate) { + this._close(); + return; + } + this._keyboardRestingId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, KEYBOARD_REST_TIME, () => {