mirror of
https://github.com/swaywm/sway.git
synced 2026-04-18 06:46:56 -04:00
chore: assign SWAY_SCENE_DESC_VIEW to popup scene
This commit is contained in:
parent
f817c80779
commit
b09db5b7a4
1 changed files with 15 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "sway/input/seat.h"
|
#include "sway/input/seat.h"
|
||||||
|
#include "sway/scene_descriptor.h"
|
||||||
#include "sway/tree/root.h"
|
#include "sway/tree/root.h"
|
||||||
#include "sway/tree/view.h"
|
#include "sway/tree/view.h"
|
||||||
#include "sway/input/text_input.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);
|
wlr_scene_node_coords(&layer->tree->node, &lx, &ly);
|
||||||
parent.x = lx;
|
parent.x = lx;
|
||||||
parent.y = ly;
|
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 {
|
} else {
|
||||||
struct sway_view *view = view_from_wlr_surface(focused_surface);
|
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.width = view->geometry.width;
|
||||||
parent.height = view->geometry.height;
|
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) {
|
if (!cursor_rect) {
|
||||||
cursor.x = 0;
|
cursor.x = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue