Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/video/wayland/SDL_waylandvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@
#define SDL_WL_DATA_DEVICE_VERSION 3

// wl_fixes was introduced in 1.24.0
#if SDL_WAYLAND_CHECK_VERSION(1, 24, 0)
#if SDL_WAYLAND_CHECK_VERSION(1, 24, 91)
#define SDL_WL_FIXES_VERSION 2
#elif SDL_WAYLAND_CHECK_VERSION(1, 24, 0)
#define SDL_WL_FIXES_VERSION 1
#endif

Expand Down Expand Up @@ -560,7 +562,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)
{
// 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 = {
Expand Down Expand Up @@ -1448,7 +1454,7 @@ static void handle_registry_remove_global(void *data, struct wl_registry *regist
}

d->output_count--;
return;
goto ack_remove;
}
}

Expand All @@ -1457,9 +1463,14 @@ static void handle_registry_remove_global(void *data, struct wl_registry *regist
{
if (seat->registry_id == id) {
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 = {
Expand Down
Loading
Loading