[PATCH weston 05/11] compositor-wayland: Flush the display on commit

Kristian Høgsberg hoegsberg at gmail.com
Thu Oct 31 07:31:15 CET 2013


On Sun, Oct 27, 2013 at 10:24:57PM -0500, Jason Ekstrand wrote:
> This fixes the problem where animations will wait to play until input is
> received.  In general, it also makes the backend far more responsive.
> 
> Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
> ---
>  src/compositor-wayland.c | 3 +++
>  1 file changed, 3 insertions(+)

Let's go with this.  Ideally we would just flush once and for all
before we block again, but we're limited by the simple nature of
wl_display_run().  We could just not use that and open-code the loop,
and then emit a "pre-block" signal before we call

	wl_event_loop_dispatch(display->loop, -1);

to let compositor-wayland.c flush it's pending requests before
blocking.  But let's stick with the simpler solution here until we
come across something else that hits this problem.

Kristian

> diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
> index 76364d8..d145778 100644
> --- a/src/compositor-wayland.c
> +++ b/src/compositor-wayland.c
> @@ -271,6 +271,8 @@ static void
>  wayland_output_start_repaint_loop(struct weston_output *output_base)
>  {
>  	struct wayland_output *output = (struct wayland_output *) output_base;
> +	struct wayland_compositor *wc =
> +		(struct wayland_compositor *)output->base.compositor;
>  	struct wl_callback *callback;
>  
>  	/* If this is the initial frame, we need to attach a buffer so that
> @@ -287,6 +289,7 @@ wayland_output_start_repaint_loop(struct weston_output *output_base)
>  	callback = wl_surface_frame(output->parent.surface);
>  	wl_callback_add_listener(callback, &frame_listener, output);
>  	wl_surface_commit(output->parent.surface);
> +	wl_display_flush(wc->parent.wl_display);
>  }
>  
>  static int
> -- 
> 1.8.3.1
> 
> _______________________________________________
> 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