e_comp_wl: use ecore_device of ecore_event when gets key_down/up
authorDuna Oh <duna.oh@samsung.com>
Fri, 25 Mar 2016 09:51:39 +0000 (18:51 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Wed, 6 Apr 2016 00:50:06 +0000 (09:50 +0900)
Signed-off-by: Duna Oh <duna.oh@samsung.com>
Change-Id: I8477bb27e487b34894813f3883880919b079c935

src/bin/e_comp_wl.c

index ee16b17c74666cd6d7cb51864893d452e190b897..7f1dfdc57c824aa61ec29786649a927656b57306 100644 (file)
@@ -749,6 +749,10 @@ _e_comp_wl_evas_cb_mouse_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
         e_comp_wl->ptr.hide_tmr = ecore_timer_add(e_config->cursor_timer_interval, _e_comp_wl_cursor_timer, ec);
      }
 
+   if ((e_comp_wl->input_device_manager.last_device_name) &&
+       (_e_comp_wl_device_cap_to_class(e_comp_wl->input_device_manager.last_device_cap) == EVAS_DEVICE_CLASS_MOUSE))
+  _e_comp_wl_device_send_last_event_device(ec, ev->timestamp);
+
    if (!eina_list_count(e_comp_wl->ptr.resources)) return;
    wc = wl_resource_get_client(ec->comp_data->surface);
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
@@ -761,10 +765,6 @@ _e_comp_wl_evas_cb_mouse_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
                               wl_fixed_from_int(ev->canvas.x - ec->client.x),
                               wl_fixed_from_int(ev->canvas.y - ec->client.y));
      }
-
-      if ((e_comp_wl->input_device_manager.last_device_name) &&
-          (_e_comp_wl_device_cap_to_class(e_comp_wl->input_device_manager.last_device_cap) == EVAS_DEVICE_CLASS_MOUSE))
-     _e_comp_wl_device_send_last_event_device(ec, ev->timestamp);
 }
 
 static void
@@ -4779,9 +4779,14 @@ e_comp_wl_key_down(Ecore_Event_Key *ev)
           {
              struct wl_resource *res;
              Eina_List *l;
+             const char *name;
 
-             if (ev->dev_name)
-               _e_comp_wl_device_send_event_device(ev->dev_name, EVAS_DEVICE_CLASS_KEYBOARD, ec, ev->timestamp);
+             if (ev->dev)
+               {
+                  name = ecore_device_identifier_get(ev->dev);
+                  if (name)
+                    _e_comp_wl_device_send_event_device(name, EVAS_DEVICE_CLASS_KEYBOARD, ec, ev->timestamp);
+               }
 
              serial = wl_display_next_serial(e_comp_wl->wl.disp);
              EINA_LIST_FOREACH(e_comp_wl->kbd.focused, l, res)
@@ -4854,8 +4859,14 @@ e_comp_wl_key_up(Ecore_Event_Key *ev)
 
         if (e_comp_wl->kbd.focused)
           {
-             if (ev->dev_name)
-               _e_comp_wl_device_send_event_device(ev->dev_name, EVAS_DEVICE_CLASS_KEYBOARD, ec, ev->timestamp);
+             const char *name;
+
+             if (ev->dev)
+               {
+                  name = ecore_device_identifier_get(ev->dev);
+                  if (name)
+                    _e_comp_wl_device_send_event_device(name, EVAS_DEVICE_CLASS_KEYBOARD, ec, ev->timestamp);
+               }
 
              serial = wl_display_next_serial(e_comp_wl->wl.disp);
              EINA_LIST_FOREACH(e_comp_wl->kbd.focused, l, res)