From 9915b1c3eedad6be0eb8e3c1b0bd94cba6297d1f Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Tue, 11 Jun 2024 11:28:09 +0300 Subject: [PATCH] xdg-popup: don't emit parent's new_popup signal too early (cherry picked from commit e7deea44fdcbdf256fc7b71f2d8e29205153797a) --- types/xdg_shell/wlr_xdg_popup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/xdg_shell/wlr_xdg_popup.c b/types/xdg_shell/wlr_xdg_popup.c index e80358782..07d8d4c7d 100644 --- a/types/xdg_shell/wlr_xdg_popup.c +++ b/types/xdg_shell/wlr_xdg_popup.c @@ -420,12 +420,15 @@ void create_xdg_popup(struct wlr_xdg_surface *surface, if (parent) { surface->popup->parent = parent->surface; wl_list_insert(&parent->popups, &surface->popup->link); - wl_signal_emit_mutable(&parent->events.new_popup, surface->popup); } else { wl_list_init(&surface->popup->link); } set_xdg_surface_role_object(surface, surface->popup->resource); + + if (parent) { + wl_signal_emit_mutable(&parent->events.new_popup, surface->popup); + } } void reset_xdg_popup(struct wlr_xdg_popup *popup) {