[mutter] wayland/surface: Post error on invalid scale
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland/surface: Post error on invalid scale
- Date: Wed, 26 Jun 2019 19:35:25 +0000 (UTC)
commit f2fb3945d18de3b857ea22ae5a545e6488c112d9
Author: Robert Mader <robert mader posteo de>
Date: Mon Mar 11 14:33:38 2019 +0100
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
src/wayland/meta-wayland-surface.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index f63d6d876..3bf9bc9ce 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]