uint32_t serial;
int x, y;
E_Comp_Config *comp_conf;
- E_Comp_Wl_Data_Offer *offer;
+ E_Comp_Wl_Data_Offer *offer, *old_offer;
E_Comp_Wl_Data *comp_wl;
+ E_Comp_Wl_Data_Source *drag_source;
+
struct wl_resource *surface = e_comp_wl_client_surface_get(ec);
if (!surface) return;
data_device_res =
e_comp_wl_data_find_for_client(wl_resource_get_client(surface));
-
if (!data_device_res) return;
- offer_res = e_comp_wl_data_device_send_offer(ec);
comp_wl = e_comp_wl_get();
- if (comp_wl->drag_source)
- {
- E_Comp_Wl_Data_Source *drag_source = comp_wl->drag_source;
- E_Comp_Wl_Data_Offer *new_offer;
- E_Comp_Wl_Data_Offer *old_offer = comp_wl->drag_offer;
+ if (!comp_wl || !comp_wl->drag_source) return;
- if (!offer_res) return;
+ offer_res = e_comp_wl_data_device_send_offer(ec);
+ if (!offer_res) return;
- if (old_offer &&
- (old_offer->source == drag_source))
- {
- old_offer->dropped = EINA_FALSE;
- old_offer->source = NULL;
- }
- drag_source->accepted = EINA_FALSE;
+ drag_source = comp_wl->drag_source;
+ old_offer = comp_wl->drag_offer;
- new_offer = wl_resource_get_user_data(offer_res);
- comp_wl->drag_offer = new_offer;
- if (new_offer)
- {
- _e_comp_wl_data_offer_update_action(new_offer);
- if (wl_resource_get_version(offer_res) >= WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION)
- wl_data_offer_send_source_actions(offer_res, new_offer->source->dnd_actions);
- }
+ if (old_offer && (old_offer->source == drag_source))
+ {
+ old_offer->dropped = EINA_FALSE;
+ old_offer->source = NULL;
}
+ drag_source->accepted = EINA_FALSE;
+
+ offer = wl_resource_get_user_data(offer_res);
+ comp_wl->drag_offer = offer;
+
+ _e_comp_wl_data_offer_update_action(offer);
+ if (wl_resource_get_version(offer_res) >= WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION)
+ wl_data_offer_send_source_actions(offer_res, offer->source->dnd_actions);
comp_wl->selection.target = ec;
offer = wl_resource_get_user_data(offer_res);