summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-03-16 15:51:29 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-03-16 15:51:29 +0100
commit379b306e27794b431b78c2634080070bf14ef50b (patch)
tree8c22c5fcb54802851d8197e45dadb740abf0eefd
parentaf07655fc7db8ef7c046fd59af62b2c9d192c6f5 (diff)
downloadenlightenment-devs/bu5hm4n/xkb-fix.tar.gz
add skip event counterdevs/bu5hm4n/xkb-fix
if we are setting the group or the set of groups in e we will receive a XkbNotifyState Event from x, which will result in a ECORE_X_EVENT_XKB_STATE_NOTIFY event. We are setting there again our settings, since we need to reset the settings from a potential external application. So we should only reset our settings when the event is not expected by e.
-rw-r--r--src/bin/e_xkb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bin/e_xkb.c b/src/bin/e_xkb.c
index 1bd7340134..c9eec0063e 100644
--- a/src/bin/e_xkb.c
+++ b/src/bin/e_xkb.c
@@ -4,6 +4,8 @@ static void _e_xkb_update_event(int);
static int _e_xkb_cur_group = -1;
static Ecore_Event_Handler *xkb_state_handler = NULL;
+static int _e_xkb_skip_events = 0;
+
E_API int E_EVENT_XKB_CHANGED = 0;
@@ -33,6 +35,12 @@ _e_xkb_init_timer(void *data)
static Eina_Bool
_xkb_changed_state(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
+ if (_e_xkb_skip_events > 0)
+ {
+ _e_xkb_skip_events--;
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
#if 0
Ecore_X_Event_Xkb *ev = (Ecore_X_Event_Xkb *)event;
@@ -97,6 +105,7 @@ _e_x_xkb_update(int cur_group)
if (cur_group != -1)
{
_e_xkb_cur_group = cur_group;
+ _e_xkb_skip_events ++;
#ifndef HAVE_WAYLAND_ONLY
if (e_comp->root)
ecore_x_xkb_select_group(cur_group);
@@ -182,6 +191,7 @@ _e_x_xkb_update(int cur_group)
}
}
}
+ _e_xkb_skip_events ++;
INF("SET XKB RUN: %s", eina_strbuf_string_get(buf));
ecore_exe_run(eina_strbuf_string_get(buf), NULL);
eina_strbuf_free(buf);