aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-11-09 18:59:05 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-11-09 18:59:45 +0000
commit85220a554393280191c9c1507205ec5bffbc9031 (patch)
tree331140bc06849f5390062419110a0b3346d10a0a
parentMerge branch 'jeromenerf-patch-1' (diff)
wayland: use wl_*_release() instead of wl_*_destroy()
This lets the compositor free up internal state.
-rw-r--r--wayland.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/wayland.c b/wayland.c
index ae285a50..37b47f30 100644
--- a/wayland.c
+++ b/wayland.c
@@ -159,14 +159,14 @@ seat_destroy(struct seat *seat)
if (seat->primary_selection_device != NULL)
zwp_primary_selection_device_v1_destroy(seat->primary_selection_device);
if (seat->data_device != NULL)
- wl_data_device_destroy(seat->data_device);
+ wl_data_device_release(seat->data_device);
if (seat->wl_keyboard != NULL)
- wl_keyboard_destroy(seat->wl_keyboard);
+ wl_keyboard_release(seat->wl_keyboard);
if (seat->wl_pointer != NULL)
- wl_pointer_destroy(seat->wl_pointer);
+ wl_pointer_release(seat->wl_pointer);
if (seat->wl_seat != NULL)
- wl_seat_destroy(seat->wl_seat);
+ wl_seat_release(seat->wl_seat);
free(seat->clipboard.text);
free(seat->primary.text);
@@ -893,7 +893,7 @@ monitor_destroy(struct monitor *mon)
if (mon->xdg != NULL)
zxdg_output_v1_destroy(mon->xdg);
if (mon->output != NULL)
- wl_output_destroy(mon->output);
+ wl_output_release(mon->output);
free(mon->make);
free(mon->model);
free(mon->name);
@@ -914,7 +914,7 @@ handle_global_remove(void *data, struct wl_registry *registry, uint32_t name)
if (mon->wl_name != name)
continue;
- LOG_INFO("monitor unplugged: %s", mon->name);
+ LOG_INFO("monitor unplugged or disabled: %s", mon->name);
/*
* Update all terminals that are mapped here. On Sway 1.4,
@@ -1162,8 +1162,10 @@ wayl_destroy(struct wayland *wayl)
wl_registry_destroy(wayl->registry);
if (wayl->fd != -1)
fdm_del_no_close(wayl->fdm, wayl->fd);
- if (wayl->display != NULL)
+ if (wayl->display != NULL) {
+ wayl_flush(wayl);
wl_display_disconnect(wayl->display);
+ }
free(wayl);
}