Skip to content

Commit

Permalink
wayland: bump wayland-protocols to 1.25
Browse files Browse the repository at this point in the history
1.27 would have been nicer but ubuntu 22.04 is on 1.25 so we'll just
compromise.
  • Loading branch information
Dudemanguy committed Jun 16, 2023
1 parent 45e2ca5 commit ca08bf5
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 23 deletions.
2 changes: 0 additions & 2 deletions generated/wayland/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ protocols = [[wl_protocol_dir, 'stable/presentation-time/presentation-time.xml']
wl_protocols_source = []
wl_protocols_headers = []

features += {'wayland_protocols_1_24': wayland['deps'][2].version().version_compare('>=1.24')}

features += {'wayland_protocols_1_27': wayland['deps'][2].version().version_compare('>=1.27')}
if features['wayland_protocols_1_27']
protocols += [[wl_protocol_dir, 'staging/content-type/content-type-v1.xml'],
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ endif
wayland = {
'deps': [dependency('wayland-client', version: '>= 1.20.0', required: get_option('wayland')),
dependency('wayland-cursor', version: '>= 1.20.0', required: get_option('wayland')),
dependency('wayland-protocols', version: '>= 1.15', required: get_option('wayland')),
dependency('wayland-protocols', version: '>= 1.25', required: get_option('wayland')),
dependency('xkbcommon', version: '>= 0.3.0', required: get_option('wayland'))],
'header': cc.has_header('linux/input-event-codes.h', required: get_option('wayland')),
'scanner': find_program('wayland-scanner', required: get_option('wayland')),
Expand Down
12 changes: 0 additions & 12 deletions video/out/wayland_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,6 @@ static void surface_handle_leave(void *data, struct wl_surface *wl_surface,
}

#ifdef HAVE_WAYLAND_1_22

static void surface_handle_preferred_buffer_scale(void *data,
struct wl_surface *wl_surface,
int32_t scale)
Expand Down Expand Up @@ -828,7 +827,6 @@ static void surface_handle_preferred_buffer_transform(void *data,
uint32_t transform)
{
}

#endif

static const struct wl_surface_listener surface_listener = {
Expand Down Expand Up @@ -987,22 +985,18 @@ static void handle_toplevel_close(void *data, struct xdg_toplevel *xdg_toplevel)
mp_input_put_key(wl->vo->input_ctx, MP_KEY_CLOSE_WIN);
}

#ifdef XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION
static void handle_configure_bounds(void *data, struct xdg_toplevel *xdg_toplevel,
int32_t width, int32_t height)
{
struct vo_wayland_state *wl = data;
wl->bounded_width = width * wl->scaling;
wl->bounded_height = height * wl->scaling;
}
#endif

static const struct xdg_toplevel_listener xdg_toplevel_listener = {
handle_toplevel_config,
handle_toplevel_close,
#ifdef XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION
handle_configure_bounds,
#endif
};

#if HAVE_WAYLAND_PROTOCOLS_1_31
Expand Down Expand Up @@ -1176,7 +1170,6 @@ static const struct zwp_linux_dmabuf_v1_listener dmabuf_listener = {
dmabuf_format
};

#if HAVE_WAYLAND_PROTOCOLS_1_24
static void done(void *data,
struct zwp_linux_dmabuf_feedback_v1 *zwp_linux_dmabuf_feedback_v1)
{
Expand Down Expand Up @@ -1236,7 +1229,6 @@ static const struct zwp_linux_dmabuf_feedback_v1_listener dmabuf_feedback_listen
tranche_formats,
tranche_flags,
};
#endif

static void registry_handle_add(void *data, struct wl_registry *reg, uint32_t id,
const char *interface, uint32_t ver)
Expand Down Expand Up @@ -1267,10 +1259,8 @@ static void registry_handle_add(void *data, struct wl_registry *reg, uint32_t id

if (!strcmp (interface, zwp_linux_dmabuf_v1_interface.name) && (ver >= 4) && found++) {
wl->dmabuf = wl_registry_bind(reg, id, &zwp_linux_dmabuf_v1_interface, 4);
#if HAVE_WAYLAND_PROTOCOLS_1_24
wl->dmabuf_feedback = zwp_linux_dmabuf_v1_get_default_feedback(wl->dmabuf);
zwp_linux_dmabuf_feedback_v1_add_listener(wl->dmabuf_feedback, &dmabuf_feedback_listener, wl);
#endif
} else if (!strcmp (interface, zwp_linux_dmabuf_v1_interface.name) && (ver >= 2) && found++) {
wl->dmabuf = wl_registry_bind(reg, id, &zwp_linux_dmabuf_v1_interface, 2);
zwp_linux_dmabuf_v1_add_listener(wl->dmabuf, &dmabuf_listener, wl);
Expand Down Expand Up @@ -2397,10 +2387,8 @@ void vo_wayland_uninit(struct vo *vo)
if (wl->dmabuf)
zwp_linux_dmabuf_v1_destroy(wl->dmabuf);

#if HAVE_WAYLAND_PROTOCOLS_1_24
if (wl->dmabuf_feedback)
zwp_linux_dmabuf_feedback_v1_destroy(wl->dmabuf_feedback);
#endif

if (wl->seat)
wl_seat_destroy(wl->seat);
Expand Down
3 changes: 1 addition & 2 deletions video/out/wayland_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ struct vo_wayland_state {

/* linux-dmabuf */
struct zwp_linux_dmabuf_v1 *dmabuf;
/* TODO: unvoid this if required wayland protocols is bumped to 1.24+ */
void *dmabuf_feedback;
struct zwp_linux_dmabuf_feedback_v1 *dmabuf_feedback;
wayland_format *format_map;
uint32_t format_size;
bool using_dmabuf_wayland;
Expand Down
2 changes: 1 addition & 1 deletion waftools/checks/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def check_lua(ctx, dependency_identifier):

def check_wl_protocols(ctx, dependency_identifier):
def fn(ctx, dependency_identifier):
ret = check_pkg_config_datadir("wayland-protocols", ">= 1.15")
ret = check_pkg_config_datadir("wayland-protocols", ">= 1.25")
ret = ret(ctx, dependency_identifier)
if ret != None:
ctx.env.WL_PROTO_DIR = ret.split()[0]
Expand Down
5 changes: 0 additions & 5 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -544,11 +544,6 @@ video_output_features = [
'func': check_pkg_config('wayland-client', '>= 1.20.0',
'wayland-cursor', '>= 1.20.0',
'xkbcommon', '>= 0.3.0'),
} , {
'name': 'wayland-protocols-1-24',
'desc': 'wayland-protocols version 1.24+',
'deps': 'wayland',
'func': check_pkg_config('wayland-protocols >= 1.24'),
} , {
'name': 'wayland-protocols-1-27',
'desc': 'wayland-protocols version 1.27+',
Expand Down

0 comments on commit ca08bf5

Please sign in to comment.