diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index 0f9fbf10b..fdb5b507a 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -1100,6 +1100,7 @@ e_comp_init(void) char buf[128]; snprintf(buf, sizeof(buf), "wl_%s", eng); + e_xkb_init(E_PIXMAP_TYPE_WL); if (e_module_enable(e_module_new(buf))) { e_comp->comp_type = E_PIXMAP_TYPE_WL; @@ -1110,7 +1111,10 @@ e_comp_init(void) #ifndef HAVE_WAYLAND_ONLY if (e_comp_x_init()) - e_comp->comp_type = E_PIXMAP_TYPE_X; + { + e_comp->comp_type = E_PIXMAP_TYPE_X; + e_xkb_init(E_PIXMAP_TYPE_X); + } else #endif { @@ -1132,6 +1136,7 @@ e_comp_init(void) NULL }; + e_xkb_init(E_PIXMAP_TYPE_WL); e_util_env_set("HYBRIS_EGLPLATFORM", "wayland"); for (test = eng; *test; test++) { diff --git a/src/bin/e_main.c b/src/bin/e_main.c index f70e506f9..7993aa4c5 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -1615,13 +1615,6 @@ _e_main_screens_init(void) e_error_message_show(_("Enlightenment cannot create a compositor.\n")); _e_main_shutdown(-1); } - TS("E_Xkb Init"); - if (!e_xkb_init()) - { - e_error_message_show(_("Enlightenment cannot setup XKB Keyboard layouts.\n")); - _e_main_shutdown(-1); - } - TS("E_Xkb Init Done"); _e_main_desk_restore(); diff --git a/src/bin/e_xkb.c b/src/bin/e_xkb.c index 36a7ac9ee..3f8815286 100644 --- a/src/bin/e_xkb.c +++ b/src/bin/e_xkb.c @@ -1,7 +1,7 @@ #include "e.h" static void _e_xkb_update_event(int); - +static void _e_xkb_type_update(E_Pixmap_Type comp_type, int cur_group); static int _e_xkb_cur_group = -1; static Ecore_Event_Handler *xkb_state_handler = NULL; static int _e_xkb_skip_events = 0; @@ -67,16 +67,16 @@ _xkb_changed_state(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) /* externally accessible functions */ E_API int -e_xkb_init(void) +e_xkb_init(E_Pixmap_Type comp_type) { if (!E_EVENT_XKB_CHANGED) E_EVENT_XKB_CHANGED = ecore_event_type_new(); #ifndef HAVE_WAYLAND_ONLY - if (e_comp->comp_type == E_PIXMAP_TYPE_X) + if (comp_type == E_PIXMAP_TYPE_X) xkb_state_handler = ecore_event_handler_add(ECORE_X_EVENT_XKB_STATE_NOTIFY, _xkb_changed_state, NULL); #endif if (e_config->xkb.dont_touch_my_damn_keyboard) return 1; - e_xkb_update(-1); + _e_xkb_type_update(comp_type, -1); if (e_config->xkb.cur_layout) ecore_timer_add(1.5, _e_xkb_init_timer, e_config->xkb.current_layout); else if (e_config->xkb.selected_layout) @@ -280,15 +280,21 @@ _e_wl_xkb_update(int cur_group) #endif } -E_API void -e_xkb_update(int cur_group) +static void +_e_xkb_type_update(E_Pixmap_Type comp_type, int cur_group) { - if (e_comp->comp_type == E_PIXMAP_TYPE_WL) + if (comp_type == E_PIXMAP_TYPE_WL) _e_wl_xkb_update(cur_group); else _e_x_xkb_update(cur_group); } +E_API void +e_xkb_update(int cur_group) +{ + _e_xkb_type_update(e_comp->comp_type, cur_group); +} + E_API void e_xkb_layout_next(void) { diff --git a/src/bin/e_xkb.h b/src/bin/e_xkb.h index 02b0d4058..9520e46e6 100644 --- a/src/bin/e_xkb.h +++ b/src/bin/e_xkb.h @@ -3,7 +3,7 @@ #ifndef E_XKB_H #define E_XKB_H -E_API int e_xkb_init(void); +E_API int e_xkb_init(E_Pixmap_Type comp_type); E_API int e_xkb_shutdown(void); E_API void e_xkb_update(int); E_API void e_xkb_layout_next(void); diff --git a/src/modules/xkbswitch/e_mod_config.c b/src/modules/xkbswitch/e_mod_config.c index f0f0a4de6..64f54adf5 100644 --- a/src/modules/xkbswitch/e_mod_config.c +++ b/src/modules/xkbswitch/e_mod_config.c @@ -295,8 +295,6 @@ _basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata) e_config->xkb.used_options = eina_list_append(e_config->xkb.used_options, oc); } - e_xkb_init(); - e_config_save_queue(); return 1; }