[PATCH] weston:Send done event with version 2 of wl_output

Wang, Quanxian quanxian.wang at intel.com
Sat Mar 15 03:04:15 PDT 2014



>-----Original Message-----
>From: Pekka Paalanen [mailto:ppaalanen at gmail.com]
>Sent: Friday, March 14, 2014 10:58 PM
>To: Wang, Quanxian
>Cc: wayland-devel at lists.freedesktop.org; b.harrington at samsung.com
>Subject: Re: [PATCH] weston:Send done event with version 2 of wl_output
>
>On Fri, 14 Mar 2014 12:16:05 +0800
>Quanxian Wang <quanxian.wang at intel.com> wrote:
>
>> With protocol of wl_output version 2, after the output change, it
>> should send done event to all clients bound with it.
>>
>> Signed-off-by: Quanxian Wang <quanxian.wang at intel.com>
>> ---
>>  src/compositor.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/compositor.c b/src/compositor.c index
>> 7c29d51..98a4f6f 100644
>> --- a/src/compositor.c
>> +++ b/src/compositor.c
>> @@ -3245,7 +3245,7 @@ weston_output_move(struct weston_output *output,
>int x, int y)
>>  	wl_signal_emit(&output->compositor->output_moved_signal, output);
>>
>>  	/* Notify clients of the change for output position. */
>> -	wl_resource_for_each(resource, &output->resource_list)
>> +	wl_resource_for_each(resource, &output->resource_list) {
>>  		wl_output_send_geometry(resource,
>>  					output->x,
>>  					output->y,
>> @@ -3255,6 +3255,10 @@ weston_output_move(struct weston_output
>*output, int x, int y)
>>  					output->make,
>>  					output->model,
>>  					output->transform);
>> +
>> +		if (wl_resource_get_version(resource) >= 2)
>> +			wl_output_send_done(resource);
>> +	}
>>  }
>>
>>  WL_EXPORT void
>
>Hi,
>
>are you sure all the output state updates have been sent at this point?
>
>I did a quick grep, and this seems to be fine. wl_output_send_*() functions are
>only called from weston_output_switch_mode(), weston_output_move(), and
>bind_output() which must be ok as is.
>
>weston_output_move() is only called from
>weston_compositor_remove_output(), so it seems very unlikely that
>switch_mode and output_move could happen as a part of the same output
>reconfiguration.
[Wang, Quanxian] currently weston_output_move() is only called by weston_compositor_remove_output(). But you could not make sure this function will not be called by others in the future.
For example in weston randr protocol, I will reuse this code. I suggest you make it complete instead of only send geometry. Whatever wl_output geometry, scale, transform change, they should be used with done event. It is determined by wl_output design logics. Any use familiar with wl_output interface will also follow this rule. They will wait for done event after version 2 of wl_output just as you said before. Right?
>
>So, reviewed-by me.
>
>
>Thanks,
>pq


More information about the wayland-devel mailing list