diff options
author | Robert Bragg <robert@linux.intel.com> | 2012-01-12 18:16:07 +0000 |
---|---|---|
committer | Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> | 2012-06-13 15:26:19 +1000 |
commit | 882cab9a80d3ee5391ccee0637531a24ded5367c (patch) | |
tree | 38dfcbea8ee604aa82981542572fad17204c7915 | |
parent | bec05f99a73eadda556cb4341836cc10248846fc (diff) |
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.
-rw-r--r-- | composite/compalloc.c | 5 | ||||
-rw-r--r-- | composite/compositeext.h | 4 | ||||
-rw-r--r-- | 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 c5ff74edb..7e1e75f67 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -418,6 +418,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 d2c1d19d5..2456f6e95 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; } |