[PATCH 3/3] shell: avoid unnecessary busy cursor sending when not-responsing-ping client

Ander Conselvan de Oliveira conselvan2 at gmail.com
Wed Jul 18 02:45:22 PDT 2012


On 07/18/2012 08:25 AM, juan.j.zhao at linux.intel.com wrote:
> From: Juan Zhao <juan.j.zhao at linux.intel.com>
>
> When the client didn't response to ping event in time, the server
>   will do "set_busy_cursor" again and again.

You still have the problem after fixing the infinite recursion?

ping_timeout_handler() should be called just once for each unresponsive 
surface. Note that the shsurf->ping_timer is not destroyed there and 
ping_handler() will only send the ping event if shsurf->ping_timer is 
NULL. The value of shsurf->ping_timer is only altered in 
ping_timer_destroy() that is only called from shell_surface_pong() and 
destroy_shell_surface().

Can you provide the output of running weston with WAYLAND_DEBUG=1 where 
this happens?

Cheers,
Ander

> In fact it should only need to
>   set it at the first time. Because handle_pointer_focus could help to set it,
>   when the application was focused.
>
> Signed-off-by: Juan Zhao <juan.j.zhao at linux.intel.com>
> ---
>   src/shell.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/src/shell.c b/src/shell.c
> index 9372edc..04369e8 100644
> --- a/src/shell.c
> +++ b/src/shell.c
> @@ -911,6 +911,11 @@ ping_timeout_handler(void *data)
>   	struct shell_surface *shsurf = data;
>   	struct weston_seat *seat;
>
> +	/* client is already unresponding,
> +	 * no need to generate extra set_cursor action */
> +	if (shsurf->unresponsive)
> +		return 1;
> +
>   	/* Client is not responding */
>   	shsurf->unresponsive = 1;
>
>




More information about the wayland-devel mailing list