[mutter] wayland: Only send wl_output.scale event if supported by the client



commit b6f9500ccc478d5acd03e1d6d33a8fffbabaec66
Author: Jonas Ådahl <jadahl gmail com>
Date:   Mon May 5 23:37:28 2014 +0200

    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 bef2b46..05f1750 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 d599908..ab6b55f 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]