mirror of
https://github.com/brl/mutter.git
synced 2025-02-02 06:42:28 +00: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)
|
int scale)
|
||||||
{
|
{
|
||||||
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
|
MetaWaylandSurface *surface = wl_resource_get_user_data (resource);
|
||||||
if (scale > 0)
|
|
||||||
surface->pending->scale = scale;
|
if (scale <= 0)
|
||||||
else
|
{
|
||||||
g_warning ("Trying to set invalid buffer_scale of %d\n", scale);
|
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
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user