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. 8
      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);
}
}

Loading…
Cancel
Save