[PATCH weston] xwm: fix intermittent half-drawn decorations problem

Emmanuel Gil Peyrot emmanuel.peyrot at collabora.com
Tue Jan 17 17:42:37 UTC 2017


Hi,

On Tue, Jan 17, 2017 at 05:33:20PM +0200, Pekka Paalanen wrote:
> From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> 
> To reproduce the problem:
> - start weston (x11 backend worked, glamor in Xwayland makes no
>   difference)
> - start xterm
> - very very slowly move the pointer in the xterm decorations onto or
>   away from a button
> - the moment the decorations are updated, they will appear incomplete,
>   e.g. completely without buttons and title text
> - if you cause just one more pointer motion event, the decorations will
>   update to completely drawn appearance
> 
> Another way to reproduce the problem is to have an xterm and change its
> window title. This is easy if you use a shell prompt that updates the
> terminal window title. When the title updates, decorations will be
> half-drawn until something happens in XWM.
> 
> The fix: flush.
> 
> Apparently the drawing commands did not get flushed to the X server
> until any other X11 action pushed them through.
> 
> xcb_flush() is the real fix here. cairo_surface_flush() is added just
> for good measure, because documentation indicates it would be better
> used, however it was not strictly necessary to fix the problem in my
> experiments.
> 
> Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

I tried dolphin-emu which was affected by this problem due to changing
its title to display the current performances of the emulation, and
this fixes it.  Thanks!

Tested-by: Emmanuel Gil Peyrot <emmanuel.peyrot at collabora.com>
Reviewed-by: Emmanuel Gil Peyrot <emmanuel.peyrot at collabora.com>

> ---
>  xwayland/window-manager.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
> index 1dd8083..832f824 100644
> --- a/xwayland/window-manager.c
> +++ b/xwayland/window-manager.c
> @@ -1148,6 +1148,8 @@ weston_wm_window_draw_decoration(void *data)
>  	}
>  
>  	cairo_destroy(cr);
> +	cairo_surface_flush(window->cairo_surface);
> +	xcb_flush(window->wm->conn);
>  
>  	if (window->surface) {
>  		pixman_region32_fini(&window->surface->pending.opaque);
> -- 
> 2.10.2
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel

-- 
Emmanuel Gil Peyrot
Collabora Ltd.


More information about the wayland-devel mailing list