summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-05-31 23:30:32 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-05-31 23:30:32 -0400
commita4b3d0ede7fc294597164c9b35a46cd31be5640d (patch)
treef71421cd17ab527cc3c48ca5b2437c594fc7910a
parentbb1df6a7c149138693049ec17e492632135a2311 (diff)
window.c: Handle losing selection data source
-rw-r--r--clients/window.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/clients/window.c b/clients/window.c
index 2bea5c6..e78864c 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -2218,6 +2218,8 @@ data_device_selection(void *data,
input->selection_offer = wl_data_offer_get_user_data(offer);
p = wl_array_add(&input->selection_offer->types, sizeof *p);
*p = NULL;
+ } else {
+ input->selection_offer = NULL;
}
}
@@ -2348,7 +2350,9 @@ int
input_receive_selection_data_to_fd(struct input *input,
const char *mime_type, int fd)
{
- wl_data_offer_receive(input->selection_offer->offer, mime_type, fd);
+ if (input->selection_offer)
+ wl_data_offer_receive(input->selection_offer->offer,
+ mime_type, fd);
return 0;
}