From: duna.oh Date: Mon, 7 Apr 2025 05:40:06 +0000 (+0900) Subject: e_comp_wl_data: use seat info from data_device_manager's get_data_device request X-Git-Tag: accepted/tizen/unified/20250410.082858~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a33dba204367e66174a10f34df332967662fafd1;p=platform%2Fupstream%2Fenlightenment.git e_comp_wl_data: use seat info from data_device_manager's get_data_device request Change-Id: Ic2419e1c6d6b83c913df6acf9de5f5b4eebfd3b5 --- diff --git a/src/bin/server/e_comp_wl_data.c b/src/bin/server/e_comp_wl_data.c index 7267a9c50b..8dc997e579 100644 --- a/src/bin/server/e_comp_wl_data.c +++ b/src/bin/server/e_comp_wl_data.c @@ -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); }