summaryrefslogtreecommitdiff
path: root/src/data-device.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-08-06 10:31:12 -0700
committerKristian Høgsberg <krh@bitplanet.net>2013-08-06 11:15:22 -0700
commitb10b44b58cb4d7ccfffa6d286e7adb5da89df686 (patch)
tree57696a5a0bffd26597a0e4841f1267a3453b35d8 /src/data-device.c
parent3c30f0f950a616df4c899c57839ef34946ead8b1 (diff)
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.
Diffstat (limited to 'src/data-device.c')
-rw-r--r--src/data-device.c2
1 files changed, 2 insertions, 0 deletions
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);