[PATCH weston] compositor: check version before calling wl_output_send_scale()
Pekka Paalanen
ppaalanen at gmail.com
Mon Nov 10 03:32:14 PST 2014
On Wed, 5 Nov 2014 13:26:57 -0600
Derek Foreman <derekf at osg.samsung.com> wrote:
> 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);
> }
> }
>
Pushed!
Hmm, now that I look at it, yet another thing I think might need
fixing. wl_output_done gets sent even if neither scale nor mode
changed. That means weston_output_mode_switch_to_temporary() ends up
sending spurious done-events. Do I read right?
Please? :-)
Thanks,
pq
More information about the wayland-devel
mailing list