From fc58f6f053ae0dd533b58c70ed1b34ed18ef5d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Thu, 7 Mar 2024 11:20:47 +0100 Subject: [PATCH] keyboard: Don't fall back to next model after we found a valid one The fallback for creating models is to try the next one in case the current one can not be created, until we fall all the way back to the US layout. Obviously we shouldn't fall back in case creating the model actually worked, so break out of the loop and then use the new model. Part-of: --- js/ui/keyboard.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 8893d978d..00f262668 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1429,8 +1429,9 @@ export const Keyboard = GObject.registerClass({ for (const group of groups) { try { keyboardModel = new KeyboardModel(group); + break; } catch (e) { - // Ignore this error + // Ignore this error and fall back to next model } }