wayland_common: require wl_compositor of version 3

We already did require it, in order to call set_buffer_scale. This
just makes it error out more gracefully.
This commit is contained in:
Rostislav Pehlivanov authored and Jan Ekström committed 2018-05-20 02:48:23 +03:00
1 parent 43d575616c
commit 0b3d1d6faf
1 file changed
+2 -3
+2 -3
View File
@@ -782,9 +782,8 @@ static void registry_handle_add(void *data, struct wl_registry *reg, uint32_t id
int found = 1;
struct vo_wayland_state *wl = data;
if (!strcmp(interface, wl_compositor_interface.name) && found++) {
ver = MPMIN(ver, 4); /* Cap the version */
wl->compositor = wl_registry_bind(reg, id, &wl_compositor_interface, ver);
if (!strcmp(interface, wl_compositor_interface.name) && (ver >= 3) && found++) {
wl->compositor = wl_registry_bind(reg, id, &wl_compositor_interface, 3);
wl->surface = wl_compositor_create_surface(wl->compositor);
wl->cursor_surface = wl_compositor_create_surface(wl->compositor);
wl_surface_add_listener(wl->surface, &surface_listener, wl);