aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2022-08-04 22:56:20 +0200
committerKenny Levinsen <kl@kl.wtf>2022-08-06 00:20:42 +0200
commit7abe8352db188b82ff59dec945ac66ede3709375 (patch)
tree70cefe195ab8e4e62236d5427f327686390d9ef4
parent668b2740ff0fed82f8e486b2abdb536cfe8c2da9 (diff)
xdg_shell: Destroy popups after unmap event
This aligns with wlr_layer_shell_v1, and better matches how we normally use teardown signals.
-rw-r--r--types/xdg_shell/wlr_xdg_surface.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/types/xdg_shell/wlr_xdg_surface.c b/types/xdg_shell/wlr_xdg_surface.c
index c40cf35e..5c337543 100644
--- a/types/xdg_shell/wlr_xdg_surface.c
+++ b/types/xdg_shell/wlr_xdg_surface.c
@@ -31,17 +31,17 @@ void unmap_xdg_surface(struct wlr_xdg_surface *surface) {
assert(surface->role != WLR_XDG_SURFACE_ROLE_NONE);
surface->configured = false;
- struct wlr_xdg_popup *popup, *popup_tmp;
- wl_list_for_each_safe(popup, popup_tmp, &surface->popups, link) {
- wlr_xdg_popup_destroy(popup);
- }
-
// TODO: probably need to ungrab before this event
if (surface->mapped) {
surface->mapped = false;
wlr_signal_emit_safe(&surface->events.unmap, NULL);
}
+ struct wlr_xdg_popup *popup, *popup_tmp;
+ wl_list_for_each_safe(popup, popup_tmp, &surface->popups, link) {
+ wlr_xdg_popup_destroy(popup);
+ }
+
switch (surface->role) {
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
unmap_xdg_toplevel(surface->toplevel);