diff --git a/meson.build b/meson.build index 13e77d05e..ee2c89b16 100644 --- a/meson.build +++ b/meson.build @@ -37,7 +37,7 @@ udev_req = '>= 228' gudev_req = '>= 232' # wayland version requirements -wayland_server_req = '>= 1.13.0' +wayland_server_req = '>= 1.20' wayland_protocols_req = '>= 1.19' # native backend version requirements diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index befac4f84..4b3518810 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -470,10 +470,11 @@ meta_wayland_surface_state_merge_into (MetaWaylandSurfaceState *from, to->newly_attached = TRUE; to->buffer = from->buffer; - to->dx = from->dx; - to->dy = from->dy; } + to->dx = from->dx; + to->dy = from->dy; + wl_list_insert_list (&to->frame_callback_list, &from->frame_callback_list); cairo_region_union (to->surface_damage, from->surface_damage); @@ -927,6 +928,16 @@ wl_surface_attach (struct wl_client *client, pending->buffer); } + if (wl_resource_get_version (surface_resource) >= + WL_SURFACE_OFFSET_SINCE_VERSION && + (dx != 0 || dy != 0)) + { + wl_resource_post_error (surface_resource, + WL_SURFACE_ERROR_INVALID_OFFSET, + "Attaching with an offset is no longer allowed"); + return; + } + pending->newly_attached = TRUE; pending->buffer = buffer; pending->dx = dx; @@ -1155,6 +1166,20 @@ wl_surface_damage_buffer (struct wl_client *client, cairo_region_union_rectangle (pending->buffer_damage, &rectangle); } +static void +wl_surface_offset (struct wl_client *client, + struct wl_resource *surface_resource, + int32_t dx, + int32_t dy) +{ + MetaWaylandSurface *surface = wl_resource_get_user_data (surface_resource); + MetaWaylandSurfaceState *pending = surface->pending_state; + + pending->dx = dx; + pending->dy = dy; +} + + static const struct wl_surface_interface meta_wayland_wl_surface_interface = { wl_surface_destroy, wl_surface_attach, @@ -1166,6 +1191,7 @@ static const struct wl_surface_interface meta_wayland_wl_surface_interface = { wl_surface_set_buffer_transform, wl_surface_set_buffer_scale, wl_surface_damage_buffer, + wl_surface_offset, }; static void diff --git a/src/wayland/meta-wayland-versions.h b/src/wayland/meta-wayland-versions.h index 9898d5be1..5e765577b 100644 --- a/src/wayland/meta-wayland-versions.h +++ b/src/wayland/meta-wayland-versions.h @@ -35,7 +35,7 @@ /* #define META_WL_BUFFER_VERSION 1 */ /* Global/master objects (version exported by wl_registry and negotiated through bind) */ -#define META_WL_COMPOSITOR_VERSION 4 +#define META_WL_COMPOSITOR_VERSION 5 #define META_WL_DATA_DEVICE_MANAGER_VERSION 3 #define META_XDG_WM_BASE_VERSION 3 #define META_ZXDG_SHELL_V6_VERSION 1