Commit d7ec8fb6 authored by Alexandros Frantzis's avatar Alexandros Frantzis Committed by Alexandre Julliard

winewayland.drv: Fix removal of wl_seat globals.

Store and compare against the wl_seat global id (aka name) during global_remove, since the global id is distinct from the wl_proxy id which we were previously checking.
parent 24a6f367
......@@ -134,6 +134,7 @@ static void registry_handle_global(void *data, struct wl_registry *registry,
pthread_mutex_lock(&seat->mutex);
seat->wl_seat = wl_registry_bind(registry, id, &wl_seat_interface,
version < 5 ? version : 5);
seat->global_id = id;
wl_seat_add_listener(seat->wl_seat, &seat_listener, NULL);
pthread_mutex_unlock(&seat->mutex);
}
......@@ -158,14 +159,14 @@ static void registry_handle_global_remove(void *data, struct wl_registry *regist
}
seat = &process_wayland.seat;
if (seat->wl_seat &&
wl_proxy_get_id((struct wl_proxy *)seat->wl_seat) == id)
if (seat->wl_seat && seat->global_id == id)
{
TRACE("removing seat\n");
if (process_wayland.pointer.wl_pointer) wayland_pointer_deinit();
pthread_mutex_lock(&seat->mutex);
wl_seat_release(seat->wl_seat);
seat->wl_seat = NULL;
seat->global_id = 0;
pthread_mutex_unlock(&seat->mutex);
}
}
......
......@@ -83,6 +83,7 @@ struct wayland_pointer
struct wayland_seat
{
struct wl_seat *wl_seat;
uint32_t global_id;
pthread_mutex_t mutex;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment