aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-10-07 16:33:09 -0400
committerTony Crisci <tony@dubstepdish.com>2017-10-07 16:33:22 -0400
commit51de39888501bfaa2772063e78ba90e821b27c7e (patch)
tree4027bb0d26a9f4f0bbf70a52465ce0698d259fd3
parentd61621e2fa25a4c03cb9f488c0a65c4c2e198b2b (diff)
bug: fix clipboard
-rw-r--r--types/wlr_data_device_manager.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/types/wlr_data_device_manager.c b/types/wlr_data_device_manager.c
index d5a6cca9..a813754c 100644
--- a/types/wlr_data_device_manager.c
+++ b/types/wlr_data_device_manager.c
@@ -33,6 +33,10 @@ static void data_device_start_drag(struct wl_client *client,
static void data_device_set_selection(struct wl_client *client,
struct wl_resource *resource, struct wl_resource *source_resource,
uint32_t serial) {
+ if (!source_resource) {
+ return;
+ }
+
// TODO: serial validation
struct wlr_seat_handle *handle = wl_resource_get_user_data(resource);
struct wlr_data_device *device = handle->wlr_seat->data_device;
@@ -176,6 +180,10 @@ void wlr_data_device_manager_destroy(struct wlr_data_device_manager *manager) {
void wlr_data_device_set_selection(struct wlr_data_device *device,
struct wlr_data_source *source) {
+ if (device->selection == source) {
+ return;
+ }
+
if (device->selection) {
wl_list_remove(&device->selection_destroyed.link);
wlr_data_source_cancelled(device->selection);