mirror of
https://github.com/brl/mutter.git
synced 2024-11-09 23:46:33 -05:00
wayland/surface: Post error on invalid scale
To follow the spec and make faulty clients fail hard. https://gitlab.freedesktop.org/wayland/wayland/blob/master/protocol/wayland.xml#L1618 https://gitlab.gnome.org/GNOME/mutter/merge_requests/647
This commit is contained in:
parent
d7d75dd8e7
commit
f2fb3945d1
@ -1072,10 +1072,17 @@ wl_surface_set_buffer_scale (struct wl_client *client,
|
||||
int scale)
|
||||
{
|
||||
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
|
||||
if (scale > 0)
|
||||
surface->pending->scale = scale;
|
||||
else
|
||||
g_warning ("Trying to set invalid buffer_scale of %d\n", scale);
|
||||
|
||||
if (scale <= 0)
|
||||
{
|
||||
wl_resource_post_error (resource,
|
||||
WL_SURFACE_ERROR_INVALID_SCALE,
|
||||
"Trying to set invalid buffer_scale of %d\n",
|
||||
scale);
|
||||
return;
|
||||
}
|
||||
|
||||
surface->pending->scale = scale;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user