From b10b44b58cb4d7ccfffa6d286e7adb5da89df686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 6 Aug 2013 10:31:12 -0700 Subject: [PATCH] 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. --- src/data-device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/data-device.c b/src/data-device.c index 4e3f4fc0..d05b538b 100644 --- a/src/data-device.c +++ b/src/data-device.c @@ -238,6 +238,8 @@ weston_drag_set_focus(struct weston_drag *drag, struct weston_surface *surface, if (drag->data_source) offer = weston_data_source_send_offer(drag->data_source, resource); + if (offer == NULL) + return; wl_data_device_send_enter(resource, serial, surface->resource, sx, sy, offer);