From a7c659e25833406888c7b9d431dad82c7e80b59b Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Tue, 26 Jan 2016 00:55:37 +0100 Subject: [PATCH] wl: remove useless calls to e_comp_wl_input_keymap_set those calls are not needed anymore since they will be overriden by e_xkb init which takes place a few calls later --- src/bin/e_comp_wl.c | 39 ----------------------- src/modules/wl_drm/e_mod_main.c | 36 --------------------- src/modules/wl_wl/e_mod_main.c | 2 -- src/modules/wl_x11/e_mod_main.c | 56 --------------------------------- 4 files changed, 133 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 5c2a78652..69a698b5a 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -2393,45 +2393,6 @@ _e_comp_wl_compositor_create(void) ERR("Could not initialize input"); goto input_err; } - -#ifndef HAVE_WAYLAND_ONLY - if (e_comp_util_has_x()) - { - E_Config_XKB_Layout *ekbd; - Ecore_X_Atom xkb = 0; - Ecore_X_Window root = 0; - int len = 0; - unsigned char *dat; - char *rules = NULL, *model = NULL, *layout = NULL; - - if ((ekbd = e_xkb_layout_get())) - { - model = strdup(ekbd->model); - layout = strdup(ekbd->name); - } - - root = ecore_x_window_root_first_get(); - xkb = ecore_x_atom_get("_XKB_RULES_NAMES"); - ecore_x_window_prop_property_get(root, xkb, ECORE_X_ATOM_STRING, - 1024, &dat, &len); - if ((dat) && (len > 0)) - { - rules = (char *)dat; - dat += strlen((const char *)dat) + 1; - if (!model) model = strdup((const char *)dat); - dat += strlen((const char *)dat) + 1; - if (!layout) layout = strdup((const char *)dat); - } - - /* fallback */ - if (!rules) rules = strdup("evdev"); - if (!model) model = strdup("pc105"); - if (!layout) layout = strdup("us"); - - /* update compositor keymap */ - e_comp_wl_input_keymap_set(rules, model, layout, NULL, NULL, NULL, NULL); - } -#endif e_comp_wl->wl.client_disp = ecore_wl2_display_connect(NULL); /* setup module idler to load shell mmodule */ diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c index 00e1a8628..f85770140 100644 --- a/src/modules/wl_drm/e_mod_main.c +++ b/src/modules/wl_drm/e_mod_main.c @@ -693,32 +693,10 @@ _drm_read_pixels(E_Comp_Wl_Output *output, void *pixels) } } -static void -_e_mod_drm_keymap_set(struct xkb_context *ctx, struct xkb_keymap *map) -{ - struct xkb_rule_names names; - - ctx = xkb_context_new(0); - EINA_SAFETY_ON_NULL_RETURN(ctx); - - memset(&names, 0, sizeof(names)); - names.rules = strdup("evdev"); - names.model = strdup("pc105"); - names.layout = strdup("us"); - - map = xkb_map_new_from_names(ctx, &names, 0); - EINA_SAFETY_ON_NULL_RETURN(map); - - ecore_drm_device_keyboard_cached_context_set(ctx); - ecore_drm_device_keyboard_cached_keymap_set(map); -} - E_API void * e_modapi_init(E_Module *m) { int w = 0, h = 0; - struct xkb_context *ctx = NULL; - struct xkb_keymap *map = NULL; printf("LOAD WL_DRM MODULE\n"); @@ -729,8 +707,6 @@ e_modapi_init(E_Module *m) /* return NULL; */ /* } */ - _e_mod_drm_keymap_set(ctx, map); - if (e_comp_config_get()->engine == E_COMP_ENGINE_GL) { e_comp->ee = ecore_evas_new("gl_drm", 0, 0, 1, 1, NULL); @@ -780,18 +756,6 @@ e_modapi_init(E_Module *m) e_comp->pointer = e_pointer_canvas_new(e_comp->ee, EINA_TRUE); e_comp->pointer->color = EINA_TRUE; - /* FIXME: We need a way to trap for user changing the keymap inside of E - * without the event coming from X11 */ - - /* FIXME: We should make a decision here ... - * - * Fetch the keymap from drm, OR set this to what the E config is.... - */ - - /* FIXME: This is just for testing at the moment.... - * happens to jive with what drm does */ - e_comp_wl_input_keymap_set(NULL, NULL, NULL, NULL, NULL, ctx, map); - activate_handler = ecore_event_handler_add(ECORE_DRM_EVENT_ACTIVATE, _e_mod_drm_cb_activate, NULL); diff --git a/src/modules/wl_wl/e_mod_main.c b/src/modules/wl_wl/e_mod_main.c index 6040aa996..a00c58465 100644 --- a/src/modules/wl_wl/e_mod_main.c +++ b/src/modules/wl_wl/e_mod_main.c @@ -72,8 +72,6 @@ e_modapi_init(E_Module *m) e_comp->pointer = e_pointer_canvas_new(e_comp->ee, EINA_TRUE); e_comp->pointer->color = EINA_TRUE; - e_comp_wl_input_keymap_set(NULL, NULL, NULL, NULL, NULL, NULL, NULL); - ecore_evas_pointer_xy_get(e_comp->ee, &e_comp_wl->ptr.x, &e_comp_wl->ptr.y); evas_event_feed_mouse_in(e_comp->evas, 0, NULL); diff --git a/src/modules/wl_x11/e_mod_main.c b/src/modules/wl_x11/e_mod_main.c index c38694e34..45eff1390 100644 --- a/src/modules/wl_x11/e_mod_main.c +++ b/src/modules/wl_x11/e_mod_main.c @@ -11,54 +11,6 @@ _cb_delete_request(Ecore_Evas *ee EINA_UNUSED) ecore_main_loop_quit(); } -static Eina_Bool -_cb_keymap_changed(void *data EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED) -{ - E_Config_XKB_Layout *ekbd; - char *rules = NULL, *model = NULL, *layout = NULL; - Ecore_X_Atom xkb = 0; - Ecore_X_Window root = 0; - int len = 0; - unsigned char *dat; - - printf("KEYMAP CHANGED\n"); - - /* try to fetch the E keyboard layout */ - if ((ekbd = e_xkb_layout_get())) - { - model = strdup(ekbd->model); - layout = strdup(ekbd->name); - } - - /* NB: we need a 'rules' so fetch from X atoms */ - root = ecore_x_window_root_first_get(); - xkb = ecore_x_atom_get("_XKB_RULES_NAMES"); - ecore_x_window_prop_property_get(root, xkb, ECORE_X_ATOM_STRING, - 1024, &dat, &len); - if ((dat) && (len > 0)) - { - rules = (char *)dat; - dat += strlen((const char *)dat) + 1; - if (!model) model = strdup((const char *)dat); - dat += strlen((const char *)dat) + 1; - if (!layout) layout = strdup((const char *)dat); - } - - /* fallback */ - if (!rules) rules = strdup("evdev"); - if (!model) model = strdup("pc105"); - if (!layout) layout = strdup("us"); - - /* update compositor keymap */ - e_comp_wl_input_keymap_set(rules, model, layout, NULL, NULL); - - free(rules); - free(model); - free(layout); - - return ECORE_CALLBACK_PASS_ON; -} - E_API void * e_modapi_init(E_Module *m) { @@ -97,14 +49,6 @@ e_modapi_init(E_Module *m) e_comp->pointer = e_pointer_canvas_new(e_comp->ee, EINA_TRUE); e_comp->pointer->color = EINA_TRUE; - /* force a keymap update so compositor keyboard gets setup */ - _cb_keymap_changed(e_comp->wl_comp_data, 0, NULL); - - /* setup keymap_change event handler */ - kbd_hdlr = - ecore_event_handler_add(ECORE_X_EVENT_XKB_STATE_NOTIFY, - _cb_keymap_changed, e_comp->wl_comp_data); - return m; }