aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-01-24 19:07:05 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-01-27 17:10:55 +0100
commit7186ce77474fbc3fd6ed6aa679fcc12f2124de75 (patch)
treef87620e5dc7b375260c2e9fec8eb936d12dbce3a
parentb85daf94830a3ca39d59237fdb07bc33ede1c450 (diff)
downloadayatana-indicator-keyboard-7186ce77474fbc3fd6ed6aa679fcc12f2124de75.tar.gz
ayatana-indicator-keyboard-7186ce77474fbc3fd6ed6aa679fcc12f2124de75.tar.bz2
ayatana-indicator-keyboard-7186ce77474fbc3fd6ed6aa679fcc12f2124de75.zip
Send a layout-changed signal after manual selection
-rw-r--r--src/keyboard.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 1c0b22a0..ad820096 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -67,7 +67,7 @@ static gboolean onCheckEvent(Display *pDisplay, XEvent *pEvent, XPointer pData)
return FALSE;
}
-static gboolean onCheck(GSource *pSource)
+static gboolean onCheckSource(GSource *pSource)
{
Keyboard *pKeyboard = ((Source*)pSource)->pKeyboard;
XEvent cEvent;
@@ -168,7 +168,7 @@ void keyboard_AddSource(Keyboard *pKeyboard)
pKeyboard->pPrivate->cPollFD.events = G_IO_IN | G_IO_HUP | G_IO_ERR;
pKeyboard->pPrivate->cPollFD.revents = 0;
pKeyboard->pPrivate->cSourceFuncs.prepare = NULL;
- pKeyboard->pPrivate->cSourceFuncs.check = onCheck;
+ pKeyboard->pPrivate->cSourceFuncs.check = onCheckSource;
pKeyboard->pPrivate->cSourceFuncs.dispatch = NULL;
pKeyboard->pPrivate->cSourceFuncs.finalize = NULL;
@@ -222,6 +222,8 @@ void keyboard_GetLayout(Keyboard *pKeyboard, gint nLayout, gchar **pLanguage, gc
void keyboard_SetLayout(Keyboard *pKeyboard, gint nLayout)
{
xkl_engine_lock_group(pKeyboard->pPrivate->pEngine, nLayout);
+ pKeyboard->pPrivate->nLayout = nLayout;
+ g_signal_emit(pKeyboard, m_lSignals[LAYOUT_CHANGED], 0);
}
static void onDispose(GObject *pObject)