e_comp_wl_data: Consider device id to control multi touch during dragging 83/293683/2
authorJunseok Kim <juns.kim@samsung.com>
Wed, 31 May 2023 10:19:16 +0000 (19:19 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 2 Jun 2023 07:50:49 +0000 (07:50 +0000)
Change-Id: I39af2ed20b60a024912bc5482fdbac6fd1576e83

src/bin/e_comp_wl.c
src/bin/e_comp_wl.h
src/bin/e_comp_wl_data.c
src/bin/e_comp_wl_data.h
src/bin/e_dnd.c

index 9f7076b..03d9f68 100644 (file)
@@ -2411,6 +2411,16 @@ _e_comp_wl_cb_mouse_move(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mou
         int x, y;
         E_Client *ec = NULL;
         E_Client *legacy_target = e_comp_wl->selection.target;
+        int device_id = e_comp_wl_data_current_device_id_get();
+
+        if (device_id < 0)
+          {
+             e_comp_wl_data_current_device_id_set(ev->multi.device);
+          }
+        else if (device_id != ev->multi.device)
+          {
+             return ECORE_CALLBACK_RENEW;
+          }
 
         ec = e_client_input_rect_under_pointer_get(legacy_target->desk, e_comp_wl->drag_client);
         EINA_SAFETY_ON_NULL_RETURN_VAL(ec, ECORE_CALLBACK_RENEW);
index 326a3eb..3c06af2 100644 (file)
@@ -355,6 +355,7 @@ struct _E_Comp_Wl_Data
    E_Client *drag_client;
    void *drag_source;
    void *drag_offer;
+   int drag_device_id; // Ecore_Event_Mouse_Move.multi.device
 
    E_Comp_Wl_Evas_Gl *evas_gl;
 
index b848b20..d96882c 100644 (file)
@@ -692,6 +692,8 @@ _e_comp_wl_data_device_drag_finished(E_Drag *drag, int dropped)
         if (e_comp_wl->drag_offer)
           ((E_Comp_Wl_Data_Offer*)e_comp_wl->drag_offer)->dropped = EINA_TRUE;
      }
+
+   e_comp_wl_data_current_device_id_set(-1);
 }
 
 static void
@@ -763,6 +765,8 @@ _e_comp_wl_data_device_cb_drag_start(struct wl_client *client, struct wl_resourc
    if (e_comp_wl->ptr.ec)
      e_comp_wl_data_device_send_enter(e_comp_wl->ptr.ec);
    e_comp_canvas_feed_mouse_up(0);
+
+   e_comp_wl_data_current_device_id_set(-1);
 }
 
 static void
@@ -1549,3 +1553,14 @@ e_comp_wl_data_device_manual_selection_set(void *data, size_t size, Eina_List *m
    return EINA_TRUE;
 }
 
+EINTERN void
+e_comp_wl_data_current_device_id_set(int id)
+{
+   e_comp_wl->drag_device_id = id;
+}
+
+EINTERN int
+e_comp_wl_data_current_device_id_get(void)
+{
+   return e_comp_wl->drag_device_id;
+}
\ No newline at end of file
index dcccb30..0983eac 100644 (file)
@@ -103,5 +103,7 @@ E_API int e_comp_wl_clipboard_source_unref(E_Comp_Wl_Clipboard_Source *source);
 E_API E_Comp_Wl_Clipboard_Source *e_comp_wl_clipboard_source_create(const char *mime_type, uint32_t serial, int *fd);
 E_API void e_comp_wl_data_device_only_set(struct wl_resource *data_device_res, Eina_Bool set);
 E_API Eina_Bool e_comp_wl_data_device_manual_selection_set(void *data, size_t size, Eina_List *mime_list);
+EINTERN void e_comp_wl_data_current_device_id_set(int id);
+EINTERN int e_comp_wl_data_current_device_id_get(void);
 # endif
 #endif
index 5e88d3f..755cee5 100644 (file)
@@ -630,8 +630,10 @@ static Eina_Bool
 _e_dnd_cb_mouse_up(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
 {
    Ecore_Event_Mouse_Button *ev = event;
+   int device_id = e_comp_wl_data_current_device_id_get();
 
    if (ev->window != _drag_win) return ECORE_CALLBACK_PASS_ON;
+   if (ev->multi.device != device_id) return ECORE_CALLBACK_PASS_ON;
 
    if (_drag_current && _drag_current->button_mask)
      {