Skip to content

Commit

Permalink
wl: Fix request of wl_seat version and guard feature usage
Browse files Browse the repository at this point in the history
Ensure that version selection for the wl_seat interface is inside the
range [3, 7]; and properly guard usage of wl_seat_listener::name.

(cherry picked from commit 1479f99)
  • Loading branch information
aperezdc committed Mar 24, 2022
1 parent a0fff85 commit 7a88d97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions platform/wayland/cog-platform-wl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1476,15 +1476,19 @@ seat_on_capabilities (void* data, struct wl_seat* seat, uint32_t capabilities)
g_debug ("Done enumerating seat capabilities.");
}

#ifdef WL_SEAT_NAME_SINCE_VERSION
static void
seat_on_name (void *data, struct wl_seat *seat, const char *name)
{
g_debug ("Seat name: '%s'", name);
}
#endif /* WL_SEAT_NAME_SINCE_VERSION */

static const struct wl_seat_listener seat_listener = {
.capabilities = seat_on_capabilities,
#ifdef WL_SEAT_NAME_SINCE_VERSION
.name = seat_on_name,
#endif /* WL_SEAT_NAME_SINCE_VERSION */
};

static void
Expand Down

0 comments on commit 7a88d97

Please sign in to comment.