Commit 606ba7fc authored by Olivier Fourdan's avatar Olivier Fourdan Committed by Olivier Fourdan

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.

See-also: default avatarOlivier Fourdan <>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <>
parent ffd02d9b
Pipeline #225655 passed with stages
in 4 minutes and 32 seconds
...@@ -422,7 +422,7 @@ ensure_surface_for_window(WindowPtr window) ...@@ -422,7 +422,7 @@ ensure_surface_for_window(WindowPtr window)
struct wl_region *region; struct wl_region *region;
WindowPtr toplevel; WindowPtr toplevel;
if (xwl_window_get(window)) if (xwl_window_from_window(window))
return TRUE; return TRUE;
xwl_screen = xwl_screen_get(screen); xwl_screen = xwl_screen_get(screen);
Markdown is supported
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