aboutsummaryrefslogtreecommitdiff
path: root/src/keyboard-x11.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-09-15 15:48:16 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-09-15 15:48:16 +0200
commit761419285e36a00a4f0add11e464f9ede99d6416 (patch)
treede57b504a73764a6c238c241f1c1c41fefb9e94e /src/keyboard-x11.c
parentecf5e442a2d66ef6e9b97bd8e5f54c892df42d11 (diff)
parent6cd61d67a4af511717ed1b0878f106b24a8b9ed6 (diff)
downloadayatana-indicator-keyboard-761419285e36a00a4f0add11e464f9ede99d6416.tar.gz
ayatana-indicator-keyboard-761419285e36a00a4f0add11e464f9ede99d6416.tar.bz2
ayatana-indicator-keyboard-761419285e36a00a4f0add11e464f9ede99d6416.zip
Merge branch 'tari01-pr/show-layout'
Attributes GH PR #52: https://github.com/AyatanaIndicators/ayatana-indicator-keyboard/pull/52
Diffstat (limited to 'src/keyboard-x11.c')
-rw-r--r--src/keyboard-x11.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/keyboard-x11.c b/src/keyboard-x11.c
index c3161377..2e8435ff 100644
--- a/src/keyboard-x11.c
+++ b/src/keyboard-x11.c
@@ -370,6 +370,11 @@ guint keyboard_GetNumLayouts(Keyboard *pKeyboard)
return nLayouts;
}
+guint keyboard_GetLayoutIndex (Keyboard *pKeyboard)
+{
+ return pKeyboard->pPrivate->nLayout;
+}
+
void keyboard_GetLayout(Keyboard *pKeyboard, gint nLayout, gchar **pLanguage, gchar **pDescription)
{
if (nLayout == -1)
@@ -588,8 +593,14 @@ static void keyboard_init(Keyboard *self)
pLayout->sDescription = g_strdup(sDescription);
}
- g_hash_table_replace(self->pPrivate->lLayouts, pLayout->sId, pLayout);
+ gboolean bContains = g_hash_table_contains (self->pPrivate->lLayouts, pLayout->sId);
+ if (!bContains)
+ {
+ g_debug (" {\"%s\", \"%s\"}, //%s", pLayout->sLanguage, pLayout->sId, pLayout->sDescription);
+ }
+
+ g_hash_table_replace(self->pPrivate->lLayouts, pLayout->sId, pLayout);
pRxkbLayout = rxkb_layout_next(pRxkbLayout);
}