aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVäinö Mäkelä <vaino.o.makela@gmail.com>2023-06-01 10:07:53 +0300
committerSimon Ser <contact@emersion.fr>2023-06-03 10:43:12 +0000
commitf97f4496de017694cd700385b9536ddd4c645ef5 (patch)
tree3adf4394c5b14e41370781e44fc72b09059da151
parent0e5f76186ee97eee4bd68e76bee2ea90b605d529 (diff)
data-device: Handle inert seats
-rw-r--r--types/data_device/wlr_data_device.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/types/data_device/wlr_data_device.c b/types/data_device/wlr_data_device.c
index 428f7906..808aeeb8 100644
--- a/types/data_device/wlr_data_device.c
+++ b/types/data_device/wlr_data_device.c
@@ -239,6 +239,10 @@ static void data_device_manager_get_data_device(struct wl_client *client,
}
wl_resource_set_implementation(resource, &data_device_impl, seat_client,
data_device_handle_resource_destroy);
+ if (seat_client == NULL) {
+ wl_list_init(wl_resource_get_link(resource));
+ return;
+ }
wl_list_insert(&seat_client->data_devices, wl_resource_get_link(resource));
struct wlr_seat_client *focused_client =