mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-08 12:28:04 +02:00
data-device.c: Handle failure to allocate offer in weston_drag_set_focus
If we fail to allocate and send the offer, don't send the drag enter and don't set the drag focus so we don't send motion events or leave.
This commit is contained in:
parent
403931ed22
commit
95151bfc8e
1 changed files with 4 additions and 1 deletions
|
|
@ -234,8 +234,11 @@ weston_drag_set_focus(struct weston_drag *drag, struct weston_surface *surface,
|
|||
display = wl_client_get_display(wl_resource_get_client(resource));
|
||||
serial = wl_display_next_serial(display);
|
||||
|
||||
if (drag->data_source)
|
||||
if (drag->data_source) {
|
||||
offer = wl_data_source_send_offer(drag->data_source, resource);
|
||||
if (offer == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
wl_data_device_send_enter(resource, serial, surface->resource,
|
||||
sx, sy, offer);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue