[PATCH 1/3] Revert "xwayland: Redirect toplevel windows one by one"

Kristian Høgsberg krh at bitplanet.net
Thu Jan 12 11:53:57 PST 2012


On Thu, Jan 12, 2012 at 1:16 PM, Robert Bragg <robert at sixbynine.org> wrote:
> From: Robert Bragg <robert at linux.intel.com>
>
> This reverts commit 7889930ad9f0faa00e7a5d469a2b50beaf759c9f.
>
> Redirecting the windows one by one this way doesn't handle unredirecting
> windows that are reparented so they are no longer top-level windows.
> This goes back to automatically redirecting all root sub-windows which
> will handle reparenting correctly and we can hopefully find an
> alternative fix for the shutdown crash.

Great, thanks!  I never liked the manual redirection anyway and as you
say it breaks reparenting from top-level to non-top-level windows.  I
saw this problem with Google Chrome, but that now works.

I pushed the patches to my xwayland-1.10 branch in my xserver git repo.

Kristian

> ---
>  composite/compalloc.c                 |   10 +++++-----
>  composite/compositeext.h              |    4 ++--
>  hw/xfree86/xwayland/xwayland-window.c |   27 +++++++++++++--------------
>  3 files changed, 20 insertions(+), 21 deletions(-)
>
> diff --git a/composite/compalloc.c b/composite/compalloc.c
> index dd4338b..9fd460a 100644
> --- a/composite/compalloc.c
> +++ b/composite/compalloc.c
> @@ -225,11 +225,6 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update)
>     return Success;
>  }
>
> -int CompositeRedirectWindow (WindowPtr pWin, int update)
> -{
> -    return compRedirectWindow (serverClient, pWin, update);
> -}
> -
>  /*
>  * Free one of the per-client per-window resources, clearing
>  * redirect and the per-window pointer as appropriate
> @@ -396,6 +391,11 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update)
>     return Success;
>  }
>
> +int CompositeRedirectSubwindows (WindowPtr pWin, int update)
> +{
> +    return compRedirectSubwindows (serverClient, pWin, update);
> +}
> +
>  /*
>  * Free one of the per-client per-subwindows resources,
>  * which frees one redirect per subwindow
> diff --git a/composite/compositeext.h b/composite/compositeext.h
> index 0168cdc..c1e915a 100644
> --- a/composite/compositeext.h
> +++ b/composite/compositeext.h
> @@ -34,7 +34,7 @@
>  extern _X_EXPORT Bool CompositeRegisterAlternateVisuals(ScreenPtr pScreen,
>                                                         VisualID *vids,
>                                                         int nVisuals);
> -extern _X_EXPORT int CompositeRedirectWindow(WindowPtr pWin,
> -                                            int update);
> +extern _X_EXPORT int CompositeRedirectSubwindows(WindowPtr pWin,
> +                                                int update);
>
>  #endif /* _COMPOSITEEXT_H_ */
> diff --git a/hw/xfree86/xwayland/xwayland-window.c b/hw/xfree86/xwayland/xwayland-window.c
> index c10b7d8..c2d31cb 100644
> --- a/hw/xfree86/xwayland/xwayland-window.c
> +++ b/hw/xfree86/xwayland/xwayland-window.c
> @@ -105,23 +105,22 @@ xwl_create_window(WindowPtr window)
>     xwl_screen->CreateWindow = screen->CreateWindow;
>     screen->CreateWindow = xwl_create_window;
>
> -    if (!(xwl_screen->flags & XWL_FLAGS_ROOTLESS))
> +    if (!(xwl_screen->flags & XWL_FLAGS_ROOTLESS) ||
> +       window->parent != NULL)
>        return ret;
>
> -    if (window == screen->root) {
> -       len = snprintf(buffer, sizeof buffer, "_NET_WM_CM_S%d", screen->myNum);
> -       name = MakeAtom(buffer, len, TRUE);
> -       rc = AddSelection(&selection, name, serverClient);
> -       if (rc != Success)
> -           return ret;
> +    len = snprintf(buffer, sizeof buffer, "_NET_WM_CM_S%d", screen->myNum);
> +    name = MakeAtom(buffer, len, TRUE);
> +    rc = AddSelection(&selection, name, serverClient);
> +    if (rc != Success)
> +       return ret;
>
> -       selection->lastTimeChanged = currentTime;
> -       selection->window = window->drawable.id;
> -       selection->pWin = window;
> -       selection->client = serverClient;
> -    } else if (window->parent == screen->root) {
> -       CompositeRedirectWindow(window, CompositeRedirectManual);
> -    }
> +    selection->lastTimeChanged = currentTime;
> +    selection->window = window->drawable.id;
> +    selection->pWin = window;
> +    selection->client = serverClient;
> +
> +    CompositeRedirectSubwindows(window, CompositeRedirectManual);
>
>     return ret;
>  }
> --
> 1.7.7.5
>
> _______________________________________________
> 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