|
@@ -112,7 +112,9 @@
|
|
|
#define SDL_WL_DATA_DEVICE_VERSION 3
|
|
#define SDL_WL_DATA_DEVICE_VERSION 3
|
|
|
|
|
|
|
|
// wl_fixes was introduced in 1.24.0
|
|
// wl_fixes was introduced in 1.24.0
|
|
|
-#if SDL_WAYLAND_CHECK_VERSION(1, 24, 0)
|
|
|
|
|
|
|
+#if SDL_WAYLAND_CHECK_VERSION(1, 26, 0)
|
|
|
|
|
+#define SDL_WL_FIXES_VERSION 2
|
|
|
|
|
+#elif SDL_WAYLAND_CHECK_VERSION(1, 24, 0)
|
|
|
#define SDL_WL_FIXES_VERSION 1
|
|
#define SDL_WL_FIXES_VERSION 1
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
@@ -561,7 +563,11 @@ static void wayland_preferred_check_handle_global(void *data, struct wl_registry
|
|
|
|
|
|
|
|
static void wayland_preferred_check_remove_global(void *data, struct wl_registry *registry, uint32_t id)
|
|
static void wayland_preferred_check_remove_global(void *data, struct wl_registry *registry, uint32_t id)
|
|
|
{
|
|
{
|
|
|
- // No need to do anything here.
|
|
|
|
|
|
|
+ SDL_WaylandPreferredData *d = (SDL_WaylandPreferredData *)data;
|
|
|
|
|
+
|
|
|
|
|
+ if (d->wl_fixes && wl_fixes_get_version(d->wl_fixes) >= WL_FIXES_ACK_GLOBAL_REMOVE_SINCE_VERSION) {
|
|
|
|
|
+ wl_fixes_ack_global_remove(d->wl_fixes, registry, id);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static const struct wl_registry_listener preferred_registry_listener = {
|
|
static const struct wl_registry_listener preferred_registry_listener = {
|
|
@@ -1537,18 +1543,22 @@ static void handle_registry_remove_global(void *data, struct wl_registry *regist
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
d->output_count--;
|
|
d->output_count--;
|
|
|
- return;
|
|
|
|
|
|
|
+ goto ack_remove;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
SDL_WaylandSeat *seat, *temp;
|
|
SDL_WaylandSeat *seat, *temp;
|
|
|
- wl_list_for_each_safe (seat, temp, &d->seat_list, link)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ wl_list_for_each_safe (seat, temp, &d->seat_list, link) {
|
|
|
if (seat->registry_id == id) {
|
|
if (seat->registry_id == id) {
|
|
|
Wayland_SeatDestroy(seat, false);
|
|
Wayland_SeatDestroy(seat, false);
|
|
|
- return;
|
|
|
|
|
|
|
+ goto ack_remove;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ack_remove:
|
|
|
|
|
+ if (d->wl_fixes && wl_fixes_get_version(d->wl_fixes) >= WL_FIXES_ACK_GLOBAL_REMOVE_SINCE_VERSION) {
|
|
|
|
|
+ wl_fixes_ack_global_remove(d->wl_fixes, registry, id);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static const struct wl_registry_listener registry_listener = {
|
|
static const struct wl_registry_listener registry_listener = {
|