aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2023-02-03 19:25:07 +0300
committerKirill Primak <vyivel@eclair.cafe>2023-02-03 19:29:11 +0300
commitdc7b5ab21e366c7cc6deef6a76005c851e7825d3 (patch)
treea707200339e3c254280041f7249c4c9e3e8b0a73
parentb355a12751f407a1a4277ed934328395584ef567 (diff)
layer-shell: forbid changing the existing popup parent
-rw-r--r--types/wlr_layer_shell_v1.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/types/wlr_layer_shell_v1.c b/types/wlr_layer_shell_v1.c
index 355e9566..cc1ea8fe 100644
--- a/types/wlr_layer_shell_v1.c
+++ b/types/wlr_layer_shell_v1.c
@@ -220,6 +220,10 @@ static void layer_surface_handle_get_popup(struct wl_client *client,
if (!parent) {
return;
}
+ if (popup->parent != NULL) {
+ wl_resource_post_error(layer_resource, -1, "xdg_popup already has a parent");
+ return;
+ }
popup->parent = parent->surface;
wl_list_insert(&parent->popups, &popup->link);
wl_signal_emit_mutable(&parent->events.new_popup, popup);