[PATCH xwayland 1/3] xwayland: Separate DamagePtr into separate window data

Adam Jackson ajax at nwnk.net
Wed Jan 16 19:11:44 UTC 2019


On Tue, 2019-01-15 at 23:21 +0100, Carlos Garnacho wrote:
> This will be dissociated in future commits to handle the cases
> where windows are being realized before there is a compositor
> handling redirection.
> 
> In that case, we still want the DamagePtr to be registered upfront
> on RealizeWindowProc before a corresponding xwl_window might be
> created. Most notably, it cannot be lazily created on
> SetWindowPixmapProc as damage accounting gets broken. The downside
> of this is that we may create no-op DamagePtrs for windows that are
> not redirected eventually.

I don't think this downside ever happens. For rootless mode we only
create the xwl_window for windows that are already RedirectDrawManual,
and the changes you're making to xwl_realize_window are well after that
check.

> 
> @@ -552,18 +597,9 @@ xwl_realize_window(WindowPtr window)
>  
>      wl_surface_set_user_data(xwl_window->surface, xwl_window);
>  
> -    xwl_window->damage =
> -        DamageCreate(damage_report, damage_destroy, DamageReportNonEmpty,
> -                     FALSE, screen, xwl_window);
> -    if (xwl_window->damage == NULL) {
> -        ErrorF("Failed creating damage\n");
> -        goto err_surf;
> -    }
> -
>      compRedirectWindow(serverClient, window, CompositeRedirectManual);
>  
> -    DamageRegister(&window->drawable, xwl_window->damage);
> -    DamageSetReportAfterOp(xwl_window->damage, TRUE);
> +    register_damage(window);

register_damage() can fail, you've thrown away the error checking here.

- ajax



More information about the xorg-devel mailing list