[mutter/wip/surface-content: 22/22] window: Delay the showing of XWayland clients until set_window_id
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/surface-content: 22/22] window: Delay the showing of XWayland clients until set_window_id
- Date: Fri, 31 Jan 2014 22:28:20 +0000 (UTC)
commit 0a524cd7575cd0ac664fbad3380532b5c91c20ed
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Jan 30 10:26:49 2014 -0500
window: Delay the showing of XWayland clients until set_window_id
Use our new "surface_mapped" field to delay the showing of XWayland clients
until we have associated together the window's XID and the Wayland surface ID.
This ensures that when we show this window to the compositor, it will properly
use the Wayland surface for rendering, rather than trying to use COMPOSITE and
crash.
https://bugzilla.gnome.org/show_bug.cgi?id=720631
src/core/window.c | 13 +++++++++----
src/wayland/meta-xwayland.c | 2 ++
2 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index d58f41f..93bef84 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -857,7 +857,6 @@ meta_window_new_shared (MetaDisplay *display,
MetaWindowClientType client_type,
MetaWaylandSurface *surface,
Window xwindow,
- gboolean surface_mapped,
gulong existing_wm_state,
MetaCompEffect effect,
XWindowAttributes *attrs)
@@ -887,7 +886,7 @@ meta_window_new_shared (MetaDisplay *display,
window->client_type = client_type;
window->surface = surface;
window->xwindow = xwindow;
- window->surface_mapped = surface_mapped;
+ window->surface_mapped = FALSE;
/* this is in window->screen->display, but that's too annoying to
* type
@@ -1443,7 +1442,6 @@ meta_window_new_for_wayland (MetaDisplay *display,
META_WINDOW_CLIENT_TYPE_WAYLAND,
surface,
None,
- FALSE,
WithdrawnState,
META_COMP_EFFECT_CREATE,
&attrs);
@@ -1625,11 +1623,18 @@ meta_window_new (MetaDisplay *display,
META_WINDOW_CLIENT_TYPE_X11,
NULL,
xwindow,
- TRUE,
existing_wm_state,
effect,
&attrs);
+ /* When running as an X compositor, we can simply show the window now.
+ *
+ * When running as a Wayland compositor, we need to wait until we see
+ * the Wayland surface appear. We will later call meta_window_set_surface_mapped()
+ * to show the window in our in our set_surface_id implementation */
+ if (!meta_is_wayland_compositor ())
+ meta_window_set_surface_mapped (window, TRUE);
+
meta_error_trap_pop (display); /* pop the XSync()-reducing trap */
return window;
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index 33b3b8d..e15e308 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -49,6 +49,8 @@ xserver_set_window_id (struct wl_client *client,
surface->window = window;
window->surface = surface;
+
+ meta_window_set_surface_mapped (window, TRUE);
}
static const struct xserver_interface xserver_implementation = {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]