Skip to content

Commit

Permalink
Store scene layer in Layer
Browse files Browse the repository at this point in the history
  • Loading branch information
serebit committed Jul 5, 2024
1 parent 4fe2155 commit f9ac0e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/surface/layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/surface/layer.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef MAGPIE_LAYER_HPP
#define MAGPIE_LAYER_HPP

#include "server.hpp"
#include "surface.hpp"
#include "types.hpp"

Expand Down Expand Up @@ -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<std::shared_ptr<LayerSubsurface>> subsurfaces;

Expand Down

0 comments on commit f9ac0e5

Please sign in to comment.