Skip to content
Merged
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
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 28 additions & 2 deletions src/wayland/meta-wayland-surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/wayland/meta-wayland-versions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading