From 55bd4ee65ac315db298bf10deae4e73f0e256ed3 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 12 Jan 2012 18:16:07 +0000 Subject: Revert "xwayland: Redirect toplevel windows one by one" 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. --- composite/compalloc.c | 5 +++++ composite/compositeext.h | 4 ++-- hw/xfree86/xwayland/xwayland-window.c | 27 +++++++++++++-------------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/composite/compalloc.c b/composite/compalloc.c index d60165efd..2caf79eb0 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -441,6 +441,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 0168cdc93..c1e915ae1 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 c10b7d801..c2d31cbd7 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; } -- cgit v1.2.3