diff --git a/src/surface/layer.cpp b/src/surface/layer.cpp index 08371439e..3df87f827 100644 --- a/src/surface/layer.cpp +++ b/src/surface/layer.cpp @@ -84,8 +84,8 @@ static void wlr_layer_surface_v1_commit_notify(wl_listener* listener, [[maybe_un const uint32_t committed = surface.current.committed; if ((committed & WLR_LAYER_SURFACE_V1_STATE_LAYER) != 0) { - const magpie_scene_layer_t chosen_layer = magpie_layer_from_wlr_layer(surface.current.layer); - wlr_scene_node_reparent(layer.scene_node, server.scene_layers[chosen_layer]); + layer.scene_layer = magpie_layer_from_wlr_layer(surface.current.layer); + wlr_scene_node_reparent(layer.scene_node, server.scene_layers[layer.scene_layer]); } if (committed != 0) { diff --git a/src/surface/layer.hpp b/src/surface/layer.hpp index a76b6aea3..bbde4d611 100644 --- a/src/surface/layer.hpp +++ b/src/surface/layer.hpp @@ -1,6 +1,7 @@ #ifndef MAGPIE_LAYER_HPP #define MAGPIE_LAYER_HPP +#include "server.hpp" #include "surface.hpp" #include "types.hpp" @@ -34,6 +35,7 @@ class Layer final : public Surface { wlr_layer_surface_v1& wlr; wlr_scene_layer_surface_v1* scene_surface; + magpie_scene_layer_t scene_layer = MAGPIE_SCENE_LAYER_NORMAL; std::set> subsurfaces;