mirror of
https://github.com/swaywm/sway.git
synced 2024-11-24 08:51:27 +00:00
container: Assign container scene descriptor to view aswell
We have to do with for fullscreen surfaces: Fullscreen surfaces technically aren't part of their container anymore visually (so the scene doesn't have it) but we want acknowledge the container it belongs to for input reasons. This will allow us to simplify node_at_coords later.
This commit is contained in:
parent
bdcffbd611
commit
3e7306489f
|
@ -82,14 +82,6 @@ struct sway_node *node_at_coords(
|
||||||
struct sway_container *con = scene_descriptor_try_get(current,
|
struct sway_container *con = scene_descriptor_try_get(current,
|
||||||
SWAY_SCENE_DESC_CONTAINER);
|
SWAY_SCENE_DESC_CONTAINER);
|
||||||
|
|
||||||
if (!con) {
|
|
||||||
struct sway_view *view = scene_descriptor_try_get(current,
|
|
||||||
SWAY_SCENE_DESC_VIEW);
|
|
||||||
if (view) {
|
|
||||||
con = view->container;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!con) {
|
if (!con) {
|
||||||
struct sway_popup_desc *popup =
|
struct sway_popup_desc *popup =
|
||||||
scene_descriptor_try_get(current, SWAY_SCENE_DESC_POPUP);
|
scene_descriptor_try_get(current, SWAY_SCENE_DESC_POPUP);
|
||||||
|
|
|
@ -506,6 +506,8 @@ void container_destroy(struct sway_container *con) {
|
||||||
|
|
||||||
if (con->view && con->view->container == con) {
|
if (con->view && con->view->container == con) {
|
||||||
con->view->container = NULL;
|
con->view->container = NULL;
|
||||||
|
scene_descriptor_destroy(&con->view->scene_tree->node, SWAY_SCENE_DESC_CONTAINER);
|
||||||
|
|
||||||
wlr_scene_node_destroy(&con->output_handler->node);
|
wlr_scene_node_destroy(&con->output_handler->node);
|
||||||
if (con->view->destroying) {
|
if (con->view->destroying) {
|
||||||
view_destroy(con->view);
|
view_destroy(con->view);
|
||||||
|
|
|
@ -723,6 +723,8 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface,
|
||||||
view->surface = wlr_surface;
|
view->surface = wlr_surface;
|
||||||
view_populate_pid(view);
|
view_populate_pid(view);
|
||||||
view->container = container_create(view);
|
view->container = container_create(view);
|
||||||
|
scene_descriptor_assign(&view->scene_tree->node,
|
||||||
|
SWAY_SCENE_DESC_CONTAINER, view->container);
|
||||||
|
|
||||||
if (view->ctx == NULL) {
|
if (view->ctx == NULL) {
|
||||||
struct launcher_ctx *ctx = launcher_ctx_find_pid(view->pid);
|
struct launcher_ctx *ctx = launcher_ctx_find_pid(view->pid);
|
||||||
|
|
Loading…
Reference in a new issue