diff options
author | Stefan Agner <stefan@agner.ch> | 2019-06-21 00:31:59 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-07-23 16:08:04 +0000 |
commit | f6e7d2ce67e04f3687993004335e3325f01c2ae3 (patch) | |
tree | 37858dc25c896e6bda05f713562cc12c924984b7 | |
parent | a784b47533e6d43f74fcaa86e82843c5c9e308b8 (diff) |
screen-share: destroy seat on remove
Destroy seats when they get removed. This makes sure that seats
properly disappear when screen-share RDP clients disconnect.
There will be no excessive amount of mouse pointer anymore after
several client connection/disconnections.
Signed-off-by: Stefan Agner <stefan@agner.ch>
-rw-r--r-- | compositor/screen-share.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compositor/screen-share.c b/compositor/screen-share.c index 1fbc6e7e..4decbaae 100644 --- a/compositor/screen-share.c +++ b/compositor/screen-share.c @@ -87,6 +87,7 @@ struct ss_seat { struct weston_seat base; struct shared_output *output; struct wl_list link; + uint32_t id; struct { struct wl_seat *seat; @@ -366,6 +367,7 @@ ss_seat_create(struct shared_output *so, uint32_t id) weston_seat_init(&seat->base, so->output->compositor, "default"); seat->output = so; + seat->id = id; seat->parent.seat = wl_registry_bind(so->parent.registry, id, &wl_seat_interface, 1); wl_list_insert(so->seat_list.prev, &seat->link); @@ -736,6 +738,12 @@ static void registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) { + struct shared_output *so = data; + struct ss_seat *seat, *next; + + wl_list_for_each_safe(seat, next, &so->seat_list, link) + if (seat->id == name) + ss_seat_destroy(seat); } static const struct wl_registry_listener registry_listener = { |