• Olivier Fourdan's avatar
    xwayland: Create an xwl_window for toplevel only · 253569a3
    Olivier Fourdan authored
    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.
    https://bugs.winehq.org/show_bug.cgi?id=47066)
    
    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.
    
    #1099
    See-also: https://bugs.winehq.org/show_bug.cgi?id=47066Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
    Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
    (cherry picked from commit 606ba7fc)
    253569a3
xwayland.c 37.9 KB