aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-07-05 22:04:08 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-07-06 14:00:36 +0200
commit54be1fe46eac36e5a3eda8823f5c18af9d75eaee (patch)
tree20f5fd1b96778fddab1a6371aea3d6ee3e52cd07 /src
parent99562d291dbfb154ed537eddc78284b7bd652c3f (diff)
downloadayatana-indicator-keyboard-54be1fe46eac36e5a3eda8823f5c18af9d75eaee.tar.gz
ayatana-indicator-keyboard-54be1fe46eac36e5a3eda8823f5c18af9d75eaee.tar.bz2
ayatana-indicator-keyboard-54be1fe46eac36e5a3eda8823f5c18af9d75eaee.zip
src/service.c: Use 'input-keyboard' (symbolic) icon as indicator icon on Lomiri.
Diffstat (limited to 'src')
-rw-r--r--src/service.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/service.c b/src/service.c
index 73f61065..498b0996 100644
--- a/src/service.c
+++ b/src/service.c
@@ -23,6 +23,8 @@
#define BUS_NAME "org.ayatana.indicator.keyboard"
#define BUS_PATH "/org/ayatana/indicator/keyboard"
+#define ICON_DEFAULT "input-keyboard"
+
static guint m_nSignal = 0;
static void *m_pLibHandle = NULL;
static Keyboard* (*m_fnKeyboardNew)();
@@ -87,14 +89,22 @@ static GVariant* createHeaderState(IndicatorKeyboardService *self)
g_variant_builder_add(&cBuilder, "{sv}", "title", g_variant_new_string(_("Keyboard")));
g_variant_builder_add(&cBuilder, "{sv}", "visible", g_variant_new_boolean(TRUE));
- gchar *sLanguage;
- m_fnKeyboardGetLayout(self->pPrivate->pKeyboard, -1, &sLanguage, NULL);
+ GIcon *pIcon = NULL;
+ if (ayatana_common_utils_is_lomiri()) {
+ pIcon = g_themed_icon_new_with_default_fallbacks(ICON_DEFAULT);
+ }
+ else
+ {
+ gchar *sLanguage;
+ m_fnKeyboardGetLayout(self->pPrivate->pKeyboard, -1, &sLanguage, NULL);
+
+ gchar *sIcon = g_strconcat("ayatana-indicator-keyboard-", sLanguage, NULL);
+ g_free(sLanguage);
- gchar *sIcon = g_strconcat("ayatana-indicator-keyboard-", sLanguage, NULL);
- g_free(sLanguage);
+ pIcon = g_themed_icon_new_with_default_fallbacks(sIcon);
+ g_free(sIcon);
+ }
- GIcon *pIcon = g_themed_icon_new_with_default_fallbacks(sIcon);
- g_free(sIcon);
g_variant_builder_add(&cBuilder, "{sv}", "accessible-desc", g_variant_new_string(_("Current keyboard layout")));
if (pIcon)