diff options
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/xdg_shell.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index f05e156f..7da86136 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -231,8 +231,9 @@ static void _close(struct sway_view *view) { | |||
231 | return; | 231 | return; |
232 | } | 232 | } |
233 | struct wlr_xdg_surface *surface = view->wlr_xdg_surface; | 233 | struct wlr_xdg_surface *surface = view->wlr_xdg_surface; |
234 | if (surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) { | 234 | if (surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL |
235 | wlr_xdg_surface_send_close(surface); | 235 | && surface->toplevel) { |
236 | wlr_xdg_toplevel_send_close(surface); | ||
236 | } | 237 | } |
237 | } | 238 | } |
238 | 239 | ||
@@ -240,7 +241,10 @@ static void close_popups_iterator(struct wlr_surface *surface, | |||
240 | int sx, int sy, void *data) { | 241 | int sx, int sy, void *data) { |
241 | struct wlr_xdg_surface *xdg_surface = | 242 | struct wlr_xdg_surface *xdg_surface = |
242 | wlr_xdg_surface_from_wlr_surface(surface); | 243 | wlr_xdg_surface_from_wlr_surface(surface); |
243 | wlr_xdg_surface_send_close(xdg_surface); | 244 | if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP |
245 | && xdg_surface->popup) { | ||
246 | wlr_xdg_popup_destroy(xdg_surface); | ||
247 | } | ||
244 | } | 248 | } |
245 | 249 | ||
246 | static void close_popups(struct sway_view *view) { | 250 | static void close_popups(struct sway_view *view) { |