xdg-shell: Mark xdg_popup surfaces as mapped

Keep the surface map state in sync with the buffer state: the surface
can be mapped it has a valid buffer, and not if it doesn't.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2022-06-01 16:56:11 +01:00 committed by Marius Vlad
parent c0ff9ed24a
commit f1fe6ec776
2 changed files with 16 additions and 0 deletions

View File

@ -841,6 +841,14 @@ weston_desktop_xdg_popup_committed(struct weston_desktop_xdg_popup *popup)
popup->committed = true;
weston_desktop_xdg_popup_update_position(popup->base.desktop_surface,
popup);
if (!weston_surface_is_mapped(wsurface) &&
weston_surface_has_content(wsurface)) {
weston_surface_map(wsurface);
} else if (weston_surface_is_mapped(wsurface) &&
!weston_surface_has_content(wsurface)) {
weston_surface_unmap(wsurface);
}
}
static void

View File

@ -962,6 +962,14 @@ weston_desktop_xdg_popup_committed(struct weston_desktop_xdg_popup *popup)
popup->committed = true;
weston_desktop_xdg_popup_update_position(popup->base.desktop_surface,
popup);
if (!weston_surface_is_mapped(wsurface) &&
weston_surface_has_content(wsurface)) {
weston_surface_map(wsurface);
} else if (weston_surface_is_mapped(wsurface) &&
!weston_surface_has_content(wsurface)) {
weston_surface_unmap(wsurface);
}
}
static void