mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 04:45:58 +01:00
xdg_shell: Destroy popups after unmap event
This aligns with wlr_layer_shell_v1, and better matches how we normally use teardown signals.
This commit is contained in:
parent
668b2740ff
commit
7abe8352db
1 changed files with 5 additions and 5 deletions
|
@ -31,17 +31,17 @@ void unmap_xdg_surface(struct wlr_xdg_surface *surface) {
|
||||||
assert(surface->role != WLR_XDG_SURFACE_ROLE_NONE);
|
assert(surface->role != WLR_XDG_SURFACE_ROLE_NONE);
|
||||||
surface->configured = false;
|
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
|
// TODO: probably need to ungrab before this event
|
||||||
if (surface->mapped) {
|
if (surface->mapped) {
|
||||||
surface->mapped = false;
|
surface->mapped = false;
|
||||||
wlr_signal_emit_safe(&surface->events.unmap, NULL);
|
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) {
|
switch (surface->role) {
|
||||||
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
case WLR_XDG_SURFACE_ROLE_TOPLEVEL:
|
||||||
unmap_xdg_toplevel(surface->toplevel);
|
unmap_xdg_toplevel(surface->toplevel);
|
||||||
|
|
Loading…
Reference in a new issue