[PATCH] simple-shm: Handle ping event.

Kristian Høgsberg hoegsberg at gmail.com
Mon May 14 06:43:04 PDT 2012


On Sat, May 12, 2012 at 11:57:42AM -0600, Scott Moreau wrote:
> Since simple-shm does not use toytoolkit, it needs to respond to ping events so it is not deemed unresponsive.

Thanks, applied.  Can we do this for simple-egl too?

> ---
>  clients/simple-shm.c |   28 ++++++++++++++++++++++++++++
>  1 files changed, 28 insertions(+), 0 deletions(-)
> 
> diff --git a/clients/simple-shm.c b/clients/simple-shm.c
> index 16f718c..cb79126 100644
> --- a/clients/simple-shm.c
> +++ b/clients/simple-shm.c
> @@ -94,6 +94,30 @@ create_shm_buffer(struct display *display,
>  	return buffer;
>  }
>  
> +static void
> +handle_ping(void *data, struct wl_shell_surface *shell_surface,
> +							uint32_t serial)
> +{
> +	wl_shell_surface_pong(shell_surface, serial);
> +}
> +
> +static void
> +handle_configure(void *data, struct wl_shell_surface *shell_surface,
> +		 uint32_t edges, int32_t width, int32_t height)
> +{
> +}
> +
> +static void
> +handle_popup_done(void *data, struct wl_shell_surface *shell_surface)
> +{
> +}
> +
> +static const struct wl_shell_surface_listener shell_surface_listener = {
> +	handle_ping,
> +	handle_configure,
> +	handle_popup_done
> +};
> +
>  static struct window *
>  create_window(struct display *display, int width, int height)
>  {
> @@ -119,6 +143,10 @@ create_window(struct display *display, int width, int height)
>  	window->shell_surface = wl_shell_get_shell_surface(display->shell,
>  							   window->surface);
>  
> +	if (window->shell_surface)
> +		wl_shell_surface_add_listener(window->shell_surface,
> +					      &shell_surface_listener, window);
> +
>  	wl_shell_surface_set_toplevel(window->shell_surface);
>  
>  	return window;
> -- 
> 1.7.7.6
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list