compositor: check version before calling wl_output_send_scale()

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
dev
Derek Foreman 10 years ago committed by Pekka Paalanen
parent 24b98d0108
commit 41bdc27393
  1. 6
      src/compositor.c

@ -105,6 +105,7 @@ static void weston_mode_switch_finish(struct weston_output *output,
struct weston_seat *seat; struct weston_seat *seat;
struct wl_resource *resource; struct wl_resource *resource;
pixman_region32_t old_output_region; pixman_region32_t old_output_region;
int version;
pixman_region32_init(&old_output_region); pixman_region32_init(&old_output_region);
pixman_region32_copy(&old_output_region, &output->region); pixman_region32_copy(&old_output_region, &output->region);
@ -157,10 +158,11 @@ static void weston_mode_switch_finish(struct weston_output *output,
output->current_mode->refresh); 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); wl_output_send_scale(resource, output->current_scale);
if (wl_resource_get_version(resource) >= 2) if (version >= WL_OUTPUT_DONE_SINCE_VERSION)
wl_output_send_done(resource); wl_output_send_done(resource);
} }
} }

Loading…
Cancel
Save