Revert "e_input: process input event asynchronously" 28/296828/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 4 Aug 2023 10:15:03 +0000 (19:15 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 4 Aug 2023 10:28:54 +0000 (19:28 +0900)
This reverts commit c7ab667d22b0e061e5ce4a20d7050caca5046461.

Change-Id: I52583ae84ad9a72b705686c7a8931f4a743d1154

src/bin/e_input_event.c
src/bin/e_input_event.h

index 17e2532..612347d 100755 (executable)
@@ -41,38 +41,10 @@ static GSourceFuncs _event_source_funcs = {
    .finalize = NULL,
 };
 
-static gboolean
-_input_event_handler(GIOChannel *source, GIOCondition condition, gpointer user_data)
-{
-    uint64_t value;
-    E_Input_Event_Source *src = user_data;
-
-    if (condition == G_IO_IN)
-      {
-         int ret = read(src->fd, &value, sizeof(uint64_t));
-         e_input_event_process(src);
-      }
-
-    return TRUE;
-}
-
 EINTERN E_Input_Event_Source *
 e_input_event_source_create()
 {
-   int fd = eventfd(0, EFD_CLOEXEC);
-   if (fd == -1)
-     {
-        ERR("Failed to create event fd\n");
-        return NULL;
-     }
-
    E_Input_Event_Source *source = (E_Input_Event_Source *)g_source_new(&_event_source_funcs, sizeof(E_Input_Event_Source));
-   source->fd = fd;
-   source->data = NULL;
-   GIOChannel *ch = g_io_channel_unix_new(source->fd);
-
-   g_io_add_watch(ch, G_IO_IN, _input_event_handler, (gpointer)source);
-
    source->ev_queue = g_queue_new();
 
    return source;
@@ -94,8 +66,6 @@ e_input_event_source_destroy(E_Input_Event_Source *source)
 
    g_list_free(source->ev_handler_list);
 
-   close(source->fd);
-
    /* should be flushed all events in ev_queue before free ev_queue */
    g_queue_free(source->ev_queue);
    g_source_destroy(&source->gsource);
@@ -238,11 +208,6 @@ _e_input_event_send(E_Input_Event_Source *source, E_Input_Event *ev)
    if (!source) return;
 
    g_queue_push_tail(source->ev_queue, ev);
-
-   uint64_t value = 1;
-   int ret = write(source->fd, &value, sizeof(uint64_t));
-   if (ret == -1)
-     ERR("failed to send event. (%p)\n", source);
 }
 
 E_API void
@@ -257,4 +222,6 @@ e_input_event_add(E_Input_Event_Source *source, int event_type, void *ev_data, e
    ev->free_func_data = free_func_data;
 
    _e_input_event_send(source, ev);
+
+   e_input_event_process(source);
 }
index 1da6fca..a869c00 100755 (executable)
@@ -26,7 +26,6 @@ struct _e_input_event_filter {
 
 struct _e_input_event_source {
     GSource gsource;
-    int fd;
 
     void *data;
     GList *ev_handler_list;