From b6f9500ccc478d5acd03e1d6d33a8fffbabaec66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 5 May 2014 23:37:28 +0200 Subject: [PATCH] wayland: Only send wl_output.scale event if supported by the client 'scale' was introduced in version 2, so only send such an event to clients which has bound a new enough version of wl_output. https://bugzilla.gnome.org/show_bug.cgi?id=729602 --- src/wayland/meta-wayland-outputs.c | 7 ++++--- src/wayland/meta-wayland-versions.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c index bef2b46d1..05f17505f 100644 --- a/src/wayland/meta-wayland-outputs.c +++ b/src/wayland/meta-wayland-outputs.c @@ -142,9 +142,10 @@ bind_output (struct wl_client *client, (int)output->crtc->current_mode->refresh_rate); output->scale = compute_scale (output); - wl_resource_post_event (resource, - WL_OUTPUT_SCALE, - output->scale); + if (version >= META_WL_OUTPUT_HAS_SCALE) + wl_resource_post_event (resource, + WL_OUTPUT_SCALE, + output->scale); if (version >= META_WL_OUTPUT_HAS_DONE) wl_resource_post_event (resource, diff --git a/src/wayland/meta-wayland-versions.h b/src/wayland/meta-wayland-versions.h index d599908fa..ab6b55f6a 100644 --- a/src/wayland/meta-wayland-versions.h +++ b/src/wayland/meta-wayland-versions.h @@ -61,6 +61,7 @@ /* The first version to implement a specific event */ #define META_WL_SEAT_HAS_NAME 2 +#define META_WL_OUTPUT_HAS_SCALE 2 #define META_WL_OUTPUT_HAS_DONE 2 #endif