From 9c26d5983e94e7d70a77359c0b8ceeeb926085b1 Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Tue, 17 Jun 2025 16:08:25 +0200 Subject: Separate layout and settings for hardware and on-screen keyboards Refurbished by Mike Gabriel, avoiding white-space changes, variable renamings and internal code block moves. Fixes: https://salsa.debian.org/ubports-team/lomiri-system-settings/-/issues/20 --- src/keyboard-x11.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/keyboard-x11.c') diff --git a/src/keyboard-x11.c b/src/keyboard-x11.c index 27dfb97c..89e78517 100644 --- a/src/keyboard-x11.c +++ b/src/keyboard-x11.c @@ -369,7 +369,7 @@ void keyboard_AddSource(Keyboard *pKeyboard) } } -guint keyboard_GetNumLayouts(Keyboard *pKeyboard) +guint keyboard_GetNumLayouts(Keyboard *pKeyboard, gboolean bOSK) { guint nLayouts = 0; @@ -390,7 +390,7 @@ guint keyboard_GetLayoutIndex (Keyboard *pKeyboard) return pKeyboard->pPrivate->nLayout; } -void keyboard_GetLayout(Keyboard *pKeyboard, gint nLayout, gchar **pLanguage, gchar **pDescription, gchar **pId) +void keyboard_GetLayout(Keyboard *pKeyboard, gboolean bOSK, gint nLayout, gchar **pLanguage, gchar **pDescription, gchar **pId) { if (nLayout == -1) { @@ -442,7 +442,7 @@ void keyboard_GetLayout(Keyboard *pKeyboard, gint nLayout, gchar **pLanguage, gc } } -void keyboard_SetLayout(Keyboard *pKeyboard, gint nLayout) +void keyboard_SetLayout(Keyboard *pKeyboard, gint nLayout, gboolean bOSK) { if (isGreeter() == FALSE) { @@ -572,6 +572,16 @@ static void onUserChanged (GDBusConnection *pConnection, const gchar *sSender, c } } +gboolean keyboard_hasHardwareKeyboard (Keyboard *self) +{ + return TRUE; +} + +gboolean keyboard_hasSoftwareKeyboard (Keyboard *self) +{ + return FALSE; +} + static void keyboard_init(Keyboard *self) { self->pPrivate = keyboard_get_instance_private(self); -- cgit v1.2.3 From a8a2962376b5c106af481c17035a89a14bdfc3c8 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Sun, 22 Jun 2025 21:42:43 +0200 Subject: src/keyboard*: Remember nLayout and nLayoutOSK separately. --- src/keyboard-x11.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/keyboard-x11.c') diff --git a/src/keyboard-x11.c b/src/keyboard-x11.c index 89e78517..75dabd6d 100644 --- a/src/keyboard-x11.c +++ b/src/keyboard-x11.c @@ -42,6 +42,7 @@ struct _KeyboardPrivate GHashTable *lLayouts; Display *pDisplay; guint nLayout; + guint nLayoutOSK; gint nXkbEventType; XklConfigRec *pConfigRec; GSList *lLayoutRec; @@ -385,7 +386,7 @@ guint keyboard_GetNumLayouts(Keyboard *pKeyboard, gboolean bOSK) return nLayouts; } -guint keyboard_GetLayoutIndex (Keyboard *pKeyboard) +guint keyboard_GetLayoutIndex (Keyboard *pKeyboard, gboolean bOSK) { return pKeyboard->pPrivate->nLayout; } -- cgit v1.2.3