From b09db5b7a4d04a56db23d7ad48a4b1ff33083224 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Tue, 23 Jan 2024 11:47:22 +0800 Subject: [PATCH] chore: assign SWAY_SCENE_DESC_VIEW to popup scene --- sway/input/text_input.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sway/input/text_input.c b/sway/input/text_input.c index c471ea558..f46bd06c5 100644 --- a/sway/input/text_input.c +++ b/sway/input/text_input.c @@ -2,6 +2,7 @@ #include #include "log.h" #include "sway/input/seat.h" +#include "sway/scene_descriptor.h" #include "sway/tree/root.h" #include "sway/tree/view.h" #include "sway/input/text_input.h" @@ -300,6 +301,13 @@ static void input_popup_update(struct sway_input_popup *popup) { wlr_scene_node_coords(&layer->tree->node, &lx, &ly); parent.x = lx; parent.y = ly; + popup->scene_tree = wlr_scene_subsurface_tree_create(root->layer_tree, popup->popup_surface->surface); + if (!scene_descriptor_assign(&popup->scene_tree->node, + SWAY_SCENE_DESC_LAYER_SHELL, layer_surface)) { + wlr_scene_node_destroy(&popup->scene_tree->node); + popup->scene_tree = NULL; + return; + } } else { struct sway_view *view = view_from_wlr_surface(focused_surface); @@ -314,8 +322,14 @@ static void input_popup_update(struct sway_input_popup *popup) { parent.width = view->geometry.width; parent.height = view->geometry.height; + popup->scene_tree = wlr_scene_subsurface_tree_create(root->layer_tree, popup->popup_surface->surface); + if (!scene_descriptor_assign(&popup->scene_tree->node, + SWAY_SCENE_DESC_VIEW, view)) { + wlr_scene_node_destroy(&popup->scene_tree->node); + popup->scene_tree = NULL; + return; + } } - popup->scene_tree = wlr_scene_subsurface_tree_create(root->layer_tree, popup->popup_surface->surface); if (!cursor_rect) { cursor.x = 0;