• Jonas Ådahl's avatar
    wayland: Untie MetaWindowXwayland lifetime from the wl_surface · b5f50028
    Jonas Ådahl authored
    For the most part, a MetaWindow is expected to live roughly as long as
    the associated wl_surface, give or take asynchronous API discrepancies.
    The exception to this rule is handling of reparenting when decorating or
    undecorating a window, when a MetaWindow on X11 is made to survive the
    unmap/map cycle. The fact that this didn't hold on Wayland caused
    various issues, such as a feedback loop where the X11 window kept being
    remapped. By making the MetaWindow lifetime for Xwayland windows being
    the same as they are on plain X11, we remove the different semantics
    here, which seem to lower the risk of hitting the race condition causing
    the feedback loop mentioned above.
    What this commit do is separate MetaWindow lifetime handling between
    native Wayland windows and Xwayland windows. Wayland windows are handled
    just as they were, i.e. unmanaged together as part of the wl_surface
    destruction; while during the Xwayland wl_surface destruction, the
    MetaWindow <-> MetaWaylandSurface association is simply broken.
    Related: https://gitlab.freedesktop.org/xorg/xserver/issues/740
    Fixes: #762
meta-wayland-wl-shell.c 24.3 KB