diff options
| author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2025-06-22 21:42:43 +0200 |
|---|---|---|
| committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2025-09-01 12:24:46 +0200 |
| commit | a8a2962376b5c106af481c17035a89a14bdfc3c8 (patch) | |
| tree | 58ff7e3018b2eb7eb5529a9fc0b97df60c7c61ea /src/keyboard-lomiri.c | |
| parent | 9c26d5983e94e7d70a77359c0b8ceeeb926085b1 (diff) | |
| download | ayatana-indicator-keyboard-a8a2962376b5c106af481c17035a89a14bdfc3c8.tar.gz ayatana-indicator-keyboard-a8a2962376b5c106af481c17035a89a14bdfc3c8.tar.bz2 ayatana-indicator-keyboard-a8a2962376b5c106af481c17035a89a14bdfc3c8.zip | |
src/keyboard*: Remember nLayout and nLayoutOSK separately.
Diffstat (limited to 'src/keyboard-lomiri.c')
| -rw-r--r-- | src/keyboard-lomiri.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/keyboard-lomiri.c b/src/keyboard-lomiri.c index d222a06a..ae2f7961 100644 --- a/src/keyboard-lomiri.c +++ b/src/keyboard-lomiri.c @@ -61,6 +61,7 @@ struct _KeyboardPrivate { GHashTable *lLayouts; guint nLayout; + guint nLayoutOSK; GSList *lLayoutRec; GSList *lLayoutRecOSK; GSList *lUsers; @@ -220,26 +221,37 @@ 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; + if (bOSK) + { + return pKeyboard->pPrivate->nLayoutOSK; + } + else + { + return pKeyboard->pPrivate->nLayout; + } } void keyboard_GetLayout(Keyboard *pKeyboard, gboolean bOSK, gint nLayout, gchar **pLanguage, gchar **pDescription, gchar **pId) { - if (nLayout == -1) - { - nLayout = pKeyboard->pPrivate->nLayout; - } GSList *lLayoutRec = NULL; if (bOSK) { + if (nLayout == -1) + { + nLayout = pKeyboard->pPrivate->nLayoutOSK; + } lLayoutRec = pKeyboard->pPrivate->lLayoutRecOSK; } else { + if (nLayout == -1) + { + nLayout = pKeyboard->pPrivate->nLayout; + } lLayoutRec = pKeyboard->pPrivate->lLayoutRec; } @@ -695,6 +707,8 @@ static void keyboard_init(Keyboard *self) rxkb_context_unref(pContext); + self->pPrivate->nLayoutOSK = 0; + // Lomiri-specific layouts const gchar *LAYOUTS[][3] = { |
