From 24487c52336714333860c0951a5410baddec259d Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 16 Mar 2016 15:08:25 +0100 Subject: [PATCH] re-apply xkb layout groups whenever an xkb event occurs If someone plugs in a external monitor, the notify event is set AND the group is changed externally. This means enlightenment cannot configure a new keyboard anymore. So we are flushing in our new config all the time, setting the old group-index again. --- src/bin/e_xkb.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/bin/e_xkb.c b/src/bin/e_xkb.c index 08785935a..1bd734013 100644 --- a/src/bin/e_xkb.c +++ b/src/bin/e_xkb.c @@ -33,6 +33,7 @@ _e_xkb_init_timer(void *data) static Eina_Bool _xkb_changed_state(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) { +#if 0 Ecore_X_Event_Xkb *ev = (Ecore_X_Event_Xkb *)event; if (ev->group < 0 || @@ -40,7 +41,15 @@ _xkb_changed_state(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) return ECORE_CALLBACK_PASS_ON; e_config->xkb.cur_group = ev->group; - _e_xkb_update_event(ev->group); +#endif + /* + * XKb_STATE_NOTIFY does not only indicate a new group setted somewhere in e, + * it also indicates that there is probebly a new set of available groups which is unknown to e + * so setting a new groupindex does not mean you have setted to a new group from the enlightenment config. + * So better reconfigure the enlightenment known configuration and ignore the sets from outside of e + */ + _e_xkb_update_event(0); + _e_xkb_update_event(e_config->xkb.cur_group); return ECORE_CALLBACK_PASS_ON; } #endif