e_comp_wl_data: use seat info from data_device_manager's get_data_device request 83/322283/2
authorduna.oh <duna.oh@samsung.com>
Mon, 7 Apr 2025 05:40:06 +0000 (14:40 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 7 Apr 2025 08:09:51 +0000 (08:09 +0000)
Change-Id: Ic2419e1c6d6b83c913df6acf9de5f5b4eebfd3b5

src/bin/server/e_comp_wl_data.c

index 7267a9c50b25a8ddf43f4c2f109257aff90c4321..8dc997e5796bbbe82abb771fab77e89da49434c9 100644 (file)
@@ -981,7 +981,7 @@ _e_comp_wl_data_device_drag_finished(E_Drag *drag, E_Dnd_Drop_Type type)
 }
 
 static void
-_e_comp_wl_data_device_cb_drag_start(struct wl_client *client EINA_UNUSED, struct wl_resource *resource EINA_UNUSED, struct wl_resource *source_resource, struct wl_resource *origin_resource, struct wl_resource *icon_resource, uint32_t serial)
+_e_comp_wl_data_device_cb_drag_start(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *source_resource, struct wl_resource *origin_resource, struct wl_resource *icon_resource, uint32_t serial)
 {
    E_Comp_Wl_Data *comp_wl;
    E_Comp_Wl_Data_Source *source;
@@ -990,6 +990,7 @@ _e_comp_wl_data_device_cb_drag_start(struct wl_client *client EINA_UNUSED, struc
    E_Desk *desk;
    int x, y;
    struct wl_client *wc;
+   E_Seat *seat = NULL;
 
    DBG("Data Device Drag Start");
 
@@ -1002,6 +1003,8 @@ _e_comp_wl_data_device_cb_drag_start(struct wl_client *client EINA_UNUSED, struc
 
    if (!(source = wl_resource_get_user_data(source_resource)))
      return;
+   seat = wl_resource_get_user_data(resource);
+   if (!seat) return;
 
    comp_wl->drag_source = source;
 
@@ -1054,14 +1057,17 @@ _e_comp_wl_data_device_cb_drag_start(struct wl_client *client EINA_UNUSED, struc
 }
 
 static void
-_e_comp_wl_data_device_cb_selection_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource EINA_UNUSED, struct wl_resource *source_resource, uint32_t serial)
+_e_comp_wl_data_device_cb_selection_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *source_resource, uint32_t serial)
 {
    E_Comp_Wl_Data_Source *source;
    E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+   E_Seat *seat = NULL;
 
    DBG("Data Device Selection Set");
    if (!source_resource) return;
    if (!(source = wl_resource_get_user_data(source_resource))) return;
+   seat = wl_resource_get_user_data(resource);
+   if (!seat) return;
 
    _e_comp_wl_data_device_selection_set(comp_wl, source, serial);
 }
@@ -1093,13 +1099,13 @@ _e_comp_wl_data_device_cb_unbind(struct wl_resource *resource)
 }
 
 static void
-_e_comp_wl_data_manager_cb_device_get(struct wl_client *client, struct wl_resource *manager_resource, uint32_t id, struct wl_resource *seat_resource EINA_UNUSED)
+_e_comp_wl_data_manager_cb_device_get(struct wl_client *client, struct wl_resource *manager_resource, uint32_t id, struct wl_resource *seat_resource)
 {
    struct wl_resource *res;
    E_Comp_Wl_Data *comp_wl = e_comp_wl_get();
+   E_Seat *seat = NULL;
    DBG("Data Manager Device Get");
 
-
    /* try to create the data device resource */
    res = wl_resource_create(client, &wl_data_device_interface, 3, id);
    if (!res)
@@ -1110,7 +1116,10 @@ _e_comp_wl_data_manager_cb_device_get(struct wl_client *client, struct wl_resour
      }
 
    eina_hash_add(comp_wl->mgr.data_resources, &client, res);
-   wl_resource_set_implementation(res, &_e_data_device_interface, comp_wl,
+   seat = wl_resource_get_user_data(seat_resource);
+   if (!seat)
+     seat = e_seat_current_get();
+   wl_resource_set_implementation(res, &_e_data_device_interface, seat,
                                   _e_comp_wl_data_device_cb_unbind);
 }