Fix keymap marshalling issue 69/307069/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Mon, 4 Mar 2024 10:37:09 +0000 (19:37 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 4 Mar 2024 10:52:24 +0000 (19:52 +0900)
Some clients request keymap before keymap is not loaded,
the timing of wm_ready file has been moved after loading keymap.

Change-Id: I8a52c2603bf580e2b19cdfbdc699d750d7e78a71
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/bin/e_input_inputs.c
src/bin/e_main.c
src/bin/e_main_intern.h

index a048ca2..5290f23 100644 (file)
@@ -7,10 +7,20 @@
 #include "e_config_intern.h"
 #include "e_device_intern.h"
 #include "e_comp_wl_input_intern.h"
+#include "e_main_intern.h"
 #include <libudev.h>
 
 #include <glib.h>
 
+#ifdef HAVE_SYSTEMD
+# include <systemd/sd-daemon.h>
+#endif
+
+#define TS_DO
+#ifdef TS_DO
+static double t0, t1, t2;
+#endif
+
 static int main_to_input_thread_pipe_fd[2] = {0, };
 
 static gboolean input_dispatch(GSource *source, GSourceFunc callback, gpointer user_data);
@@ -850,6 +860,20 @@ input_thread_start(void *data, Ecore_Thread *th)
 
    e_input_libinput_context_create(input);
 
+   e_comp_wl_input_keymap_init();
+   e_keyrouter_query_tizen_key_table();
+
+   INF("write wm_ready");
+   if (e_config->create_wm_ready)
+     e_main_create_wm_ready();
+
+#ifdef HAVE_SYSTEMD
+   TSM("[WM] Send start-up completion");
+   sd_notify(0, "READY=1");
+#else
+   TSM("[WM] Skip sending start-up completion. (no systemd)");
+#endif
+
    /* enable this input */
    if (!e_input_enable_input(input))
      {
@@ -885,9 +909,6 @@ input_thread_start(void *data, Ecore_Thread *th)
    g_source_set_callback(pipe_source, (GSourceFunc)_pipe_recv_handler, input, NULL);
    g_source_attach(pipe_source, context);
 
-   e_comp_wl_input_keymap_init();
-   e_keyrouter_query_tizen_key_table();
-
    e_keyrouter_input_handler_add();
 
    e_input_thread_id_set(gettid());
index 7135834..130bee7 100644 (file)
 #ifdef __linux__
 # include <sys/prctl.h>
 #endif
-#ifdef HAVE_SYSTEMD
-# include <systemd/sd-daemon.h>
-#endif
 
 #define MAX_LEVEL 80
 
 #define TS_DO
 #ifdef TS_DO
-# define TS(x)                                                    \
-  {                                                               \
-     t1 = ecore_time_unix_get();                                  \
-     printf("ESTART: %1.5f [%1.5f] - %s\n", t1 - t0, t1 - t2, x); \
-     t2 = t1;                                                     \
-  }
-
-# define TSB(x)                                                  \
-  do {                                                           \
-     TRACE_DS_BEGIN(ESTART: %s, x);                              \
-     TS(x);                                                      \
-  } while (0)
-# define TSE(x)                                                  \
-  do {                                                           \
-     TRACE_DS_END();                                             \
-     TS(x);                                                      \
-  } while (0)
-# define TSM(x)                                                  \
-  do {                                                           \
-     TRACE_DS_MARK(ESTART: %s, x);                               \
-     TS(x);                                                      \
-  } while (0)
 static double t0, t1, t2;
-#else
-# define TS(x)
-# define TSB(x)
-# define TSE(x)
-# define TSM(x)
 #endif
+
 /*
  * i need to make more use of these when i'm baffled as to when something is
  * up. other hooks:
@@ -141,7 +112,6 @@ static void      _e_main_desk_save(void);
 static void      _e_main_desk_restore(void);
 static Eina_Bool _e_main_cb_idle_before(void *data EINA_UNUSED);
 static Eina_Bool _e_main_cb_idle_after(void *data EINA_UNUSED);
-static void      _e_main_create_wm_ready(void);
 static void      _e_main_hooks_clean(void);
 static void      _e_main_hook_call(E_Main_Hook_Point hookpoint, void *data EINA_UNUSED);
 
@@ -813,17 +783,8 @@ main(int argc, char **argv)
 
    TSM("MAIN LOOP AT LAST");
 
-   if (e_config->create_wm_ready)
-     _e_main_create_wm_ready();
-
    TRACE_DS_END();
 
-#ifdef HAVE_SYSTEMD
-   TSM("[WM] Send start-up completion");
-   sd_notify(0, "READY=1");
-#else
-   TSM("[WM] Skip sending start-up completion. (no systemd)");
-#endif
    ecore_main_loop_begin();
 
    ELOGF("COMP", "STOPPING enlightenment...", NULL);
@@ -1231,8 +1192,8 @@ _e_main_cb_idle_after(void *data EINA_UNUSED)
    return ECORE_CALLBACK_RENEW;
 }
 
-static void
-_e_main_create_wm_ready(void)
+EINTERN void
+e_main_create_wm_ready(void)
 {
    FILE *_wmready_checker = NULL;
    const char *path_wm_ready = "/run/.wm_ready";
index 72343cc..ba9e005 100644 (file)
@@ -4,4 +4,39 @@
 #include "e_intern.h"
 #include "e_main.h"
 
+#define TS_DO
+#ifdef TS_DO
+
+# define TS(x)                                                    \
+  {                                                               \
+     t1 = ecore_time_unix_get();                                  \
+     printf("ESTART: %1.5f [%1.5f] - %s\n", t1 - t0, t1 - t2, x); \
+     t2 = t1;                                                     \
+  }
+
+# define TSB(x)                                                  \
+  do {                                                           \
+     TRACE_DS_BEGIN(ESTART: %s, x);                              \
+     TS(x);                                                      \
+  } while (0)
+# define TSE(x)                                                  \
+  do {                                                           \
+     TRACE_DS_END();                                             \
+     TS(x);                                                      \
+  } while (0)
+# define TSM(x)                                                  \
+  do {                                                           \
+     TRACE_DS_MARK(ESTART: %s, x);                               \
+     TS(x);                                                      \
+  } while (0)
+
+#else
+# define TS(x)
+# define TSB(x)
+# define TSE(x)
+# define TSM(x)
+#endif
+
+EINTERN void e_main_create_wm_ready(void);
+
 #endif