summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-01-12 18:16:07 +0000
committerKristian Høgsberg <krh@bitplanet.net>2012-03-27 09:32:00 -0400
commit55bd4ee65ac315db298bf10deae4e73f0e256ed3 (patch)
tree0499fa07082437b4e176287681cb72a349259527
parent2a8350155a8062c6f3ad98f17ed857c55c92d484 (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.c5
-rw-r--r--composite/compositeext.h4
-rw-r--r--hw/xfree86/xwayland/xwayland-window.c27
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;
}