summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2024-02-13 00:31:06 -0500
committerDudemanguy <random342@airmail.cc>2024-02-17 16:09:41 +0000
commitb86768b3568a0f700d73c606f2d010af1655f217 (patch)
tree1c0495e2907d71aa1ec334993dedf850f67ab1a6 /video/out/wayland_common.c
parentcdca02a34d8d6e166a6caca80200a570ea14f91a (diff)
downloadmpv-b86768b3568a0f700d73c606f2d010af1655f217.tar.bz2
mpv-b86768b3568a0f700d73c606f2d010af1655f217.tar.xz
wayland_common: handle removal of seats
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r--video/out/wayland_common.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 1347f1c189..a175c10775 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -217,6 +217,7 @@ static void prepare_resize(struct vo_wayland_state *wl, int width, int height);
static void remove_feedback(struct vo_wayland_feedback_pool *fback_pool,
struct wp_presentation_feedback *fback);
static void remove_output(struct vo_wayland_output *out);
+static void remove_seat(struct vo_wayland_seat *seat);
static void request_decoration_mode(struct vo_wayland_state *wl, uint32_t mode);
static void rescale_geometry(struct vo_wayland_state *wl, double old_scale);
static void set_geometry(struct vo_wayland_state *wl, bool resize);
@@ -1535,13 +1536,23 @@ static void registry_handle_add(void *data, struct wl_registry *reg, uint32_t id
static void registry_handle_remove(void *data, struct wl_registry *reg, uint32_t id)
{
struct vo_wayland_state *wl = data;
- struct vo_wayland_output *output, *tmp;
- wl_list_for_each_safe(output, tmp, &wl->output_list, link) {
+ struct vo_wayland_output *output, *output_tmp;
+ wl_list_for_each_safe(output, output_tmp, &wl->output_list, link) {
if (output->id == id) {
remove_output(output);
return;
}
}
+
+ struct vo_wayland_seat *seat, *seat_tmp;
+ wl_list_for_each_safe(seat, seat_tmp, &wl->seat_list, link) {
+ if (seat->id == id) {
+ remove_seat(seat);
+ if (seat == wl->cursor_seat)
+ wl->cursor_seat = NULL;
+ return;
+ }
+ }
}
static const struct wl_registry_listener registry_listener = {