Commit 253569a3 authored by Olivier Fourdan's avatar Olivier Fourdan 🛠
Browse files

xwayland: Create an xwl_window for toplevel only

One general assumption in Xwayland is that the xwl_window remains the
same for all the child windows of the toplevel window.

When mapping a new X11 window, ensure_surface_for_window() checks for an
existing xwl_window by using xwl_window_get() which will just check for
the registered xwl_window for the window.

That means that a client mapping a child window of an existing window
with a xwl_window will get another different xwl_window.

If an X11 client issues a Present request on the parent window, hence
placed underneath its child window of the same size, the Wayland
compositor may not send the frame callback event for the parent's
Wayland surface which is reckoned to be not visible, obscured behind
the other Wayland surface for the child X11 window.

That bug affects some games running in wine which may get 1 fps because
the repaint occurs only on timeout with a long interval (as with, e.g.

Fix ensure_surface_for_window() by using xwl_window_from_window() which
will walk the window tree, so that a child window won't get another
xwl_window than its parent.


Signed-off-by: Olivier Fourdan's avatarOlivier Fourdan <>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <>
(cherry picked from commit 606ba7fc)
parent 0811a9ff
......@@ -527,7 +527,7 @@ ensure_surface_for_window(WindowPtr window)
struct xwl_window *xwl_window;
struct wl_region *region;
if (xwl_window_get(window))
if (xwl_window_from_window(window))
return TRUE;
xwl_screen = xwl_screen_get(screen);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment