libweston: Ignore subsurface offsets

Ignore any client-supplied offset to subsurface commits to keep the same
consistency we find on other compositor.

Fix: #829
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2023-10-22 16:16:47 +03:00 committed by Daniel Stone
parent e193a178e8
commit d18fd64a15
2 changed files with 12 additions and 0 deletions

View File

@ -1978,6 +1978,8 @@ struct weston_subsurface {
/* Used for constructing the view tree */
struct wl_list unused_views;
struct weston_log_pacer subsurface_offset_pacer;
};
struct protected_surface {

View File

@ -4679,6 +4679,9 @@ surface_set_buffer_scale(struct wl_client *client,
surface->pending.status |= WESTON_SURFACE_DIRTY_SIZE;
}
static struct weston_subsurface *
weston_surface_to_subsurface(struct weston_surface *surface);
static void
surface_offset(struct wl_client *client,
struct wl_resource *resource,
@ -4686,6 +4689,13 @@ surface_offset(struct wl_client *client,
int32_t sy)
{
struct weston_surface *surface = wl_resource_get_user_data(resource);
struct weston_subsurface *subsurface = NULL;
if ((subsurface = weston_surface_to_subsurface(surface))) {
weston_log_paced(&subsurface->subsurface_offset_pacer,
1, 0, "Ignoring client subsurface offset\n");
return;
}
surface->pending.status |= WESTON_SURFACE_DIRTY_POS;
surface->pending.buf_offset = weston_coord_surface(sx, sy, surface);