aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r--sway/desktop/xdg_shell.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 152bd26f..ce6fe41a 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -236,19 +236,11 @@ static void _close(struct sway_view *view) {
236 } 236 }
237} 237}
238 238
239static void close_popups_iterator(struct wlr_surface *surface,
240 int sx, int sy, void *data) {
241 struct wlr_xdg_surface *xdg_surface =
242 wlr_xdg_surface_from_wlr_surface(surface);
243 if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP
244 && xdg_surface->popup) {
245 wlr_xdg_popup_destroy(xdg_surface);
246 }
247}
248
249static void close_popups(struct sway_view *view) { 239static void close_popups(struct sway_view *view) {
250 wlr_xdg_surface_for_each_popup(view->wlr_xdg_surface, 240 struct wlr_xdg_popup *popup, *tmp;
251 close_popups_iterator, NULL); 241 wl_list_for_each_safe(popup, tmp, &view->wlr_xdg_surface->popups, link) {
242 wlr_xdg_popup_destroy(popup->base);
243 }
252} 244}
253 245
254static void destroy(struct sway_view *view) { 246static void destroy(struct sway_view *view) {