summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-03-24 20:36:26 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-03-24 20:36:26 +0100
commit3411368ec90b8cb299d573a9ff1f6440ff403536 (patch)
tree96987c5d6317e585aee257e9a94278520901b5d7
parent33f45d1110fe8b7fdb838dbf0b7ab210748fb791 (diff)
downloadenlightenment-devs/bu5hm4n/kb.tar.gz
e_xkb: init before e_comp_wl initdevs/bu5hm4n/kb
for the case e_xkb gets initialized, we need to init it before ecore_drm is called, otherwise ecore_drm will create his own context and keymap, which will be overriden a few moment later when e_xkb is initializied. So by calling e_comp_wl_input_keymap_set before ecore_drm_init the correct context and keymap is set and no useless elements are created. The mainproblem is that the comp_type is set when the compositor is already running, so we have to pass the type at the init to the e_xkb to tell for which kind of compositor we are running.
-rw-r--r--src/bin/e_comp.c7
-rw-r--r--src/bin/e_main.c7
-rw-r--r--src/bin/e_xkb.c20
-rw-r--r--src/bin/e_xkb.h2
-rw-r--r--src/modules/xkbswitch/e_mod_config.c2
5 files changed, 20 insertions, 18 deletions
diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index 0f9fbf10b3..fdb5b507a6 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 f70e506f92..7993aa4c52 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 541eef383f..97d2a70821 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;
@@ -64,16 +64,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)
@@ -277,16 +277,22 @@ _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)
{
Eina_List *l;
diff --git a/src/bin/e_xkb.h b/src/bin/e_xkb.h
index 02b0d40587..9520e46e6c 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 f0f0a4de69..64f54adf52 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;
}