aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-12-12 11:24:32 +0100
committeremersion <contact@emersion.fr>2018-12-30 02:48:03 +0100
commita28167c255b25bdcca2f7c85dd78528265652679 (patch)
treeefa620d4f79c89a5500317394a546d9527b864b8
parentae1dd635b133dbe0e22c3b1b8ed93be0347e0865 (diff)
data-control-v1: allow clearing selection
-rw-r--r--types/wlr_data_control_v1.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/types/wlr_data_control_v1.c b/types/wlr_data_control_v1.c
index 5f7b2df5..8d8247de 100644
--- a/types/wlr_data_control_v1.c
+++ b/types/wlr_data_control_v1.c
@@ -178,12 +178,13 @@ static void control_handle_set_selection(struct wl_client *client,
struct wlr_data_control_v1 *control =
control_from_resource(control_resource);
struct client_data_source *source = source_from_resource(source_resource);
- if (control == NULL || source == NULL) {
+ if (control == NULL) {
return;
}
+ struct wlr_data_source *wlr_source = source ? &source->source : NULL;
struct wl_display *display = wl_client_get_display(client);
- wlr_seat_set_selection(control->seat, &source->source,
+ wlr_seat_set_selection(control->seat, wlr_source,
wl_display_next_serial(display));
}