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>
dev
Daniel Stone 2 years ago committed by Marius Vlad
parent c0ff9ed24a
commit f1fe6ec776
  1. 8
      libweston-desktop/xdg-shell-v6.c
  2. 8
      libweston-desktop/xdg-shell.c

@ -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

@ -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

Loading…
Cancel
Save