[PATCH weston] compositor: check version before calling wl_output_send_scale()

Derek Foreman derekf at osg.samsung.com
Wed Nov 5 11:26:57 PST 2014


Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---
 src/compositor.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 1f6700d..9dcabe3 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -105,6 +105,7 @@ static void weston_mode_switch_finish(struct weston_output *output,
 	struct weston_seat *seat;
 	struct wl_resource *resource;
 	pixman_region32_t old_output_region;
+	int version;
 
 	pixman_region32_init(&old_output_region);
 	pixman_region32_copy(&old_output_region, &output->region);
@@ -157,11 +158,12 @@ static void weston_mode_switch_finish(struct weston_output *output,
 					    output->current_mode->refresh);
 		}
 
-		if (scale_changed)
+		version = wl_resource_get_version(resource);
+		if (version >= WL_OUTPUT_SCALE_SINCE_VERSION && scale_changed)
 			wl_output_send_scale(resource, output->current_scale);
 
-		if (wl_resource_get_version(resource) >= 2)
-			   wl_output_send_done(resource);
+		if (version >= WL_OUTPUT_DONE_SINCE_VERSION)
+			wl_output_send_done(resource);
 	}
 }
 
-- 
2.1.1



More information about the wayland-devel mailing list