layer shells do not appear

This commit is contained in:
Harrison DiAmbrosio 2025-12-14 10:25:02 -05:00
parent 49a6ced28e
commit 44f694f916
4 changed files with 10 additions and 9 deletions

View file

@ -27,6 +27,7 @@ pub fn init(wlr_layer_surface: *wlr.LayerSurfaceV1) *LayerSurface {
const self = try gpa.create(LayerSurface);
self.* = .{
.output = blk: {
// These block things are dangerous
@ -61,7 +62,6 @@ pub fn init(wlr_layer_surface: *wlr.LayerSurfaceV1) *LayerSurface {
};
}
self.wlr_layer_surface.events.destroy.add(&self.destroy);
self.wlr_layer_surface.surface.events.map.add(&self.map);
self.wlr_layer_surface.surface.events.unmap.add(&self.unmap);
@ -104,8 +104,10 @@ fn handleDestroy(
fn handleMap(
listener: *wl.Listener(void)
) void {
const layer: *LayerSurface = @fieldParentPtr("map", listener);
layer.allowKeyboard();
const layer_suraface: *LayerSurface = @fieldParentPtr("map", listener);
std.log.debug("layer surface mapped", .{});
layer_suraface.output.arrangeLayers();
layer_suraface.allowKeyboard();
}
fn handleUnmap(listener: *wl.Listener(void)) void {
@ -113,6 +115,8 @@ fn handleUnmap(listener: *wl.Listener(void)) void {
// FIXME: this crashes mez when killing mez
layer_surface.output.arrangeLayers();
// TODO: Idk if this should be deiniting the layer surface entirely
layer_surface.deinit();
}
@ -122,6 +126,8 @@ fn handleCommit(
) void {
const layer_surface: *LayerSurface = @fieldParentPtr("commit", listener);
std.log.debug("layer surface commited", .{});
if (!layer_surface.wlr_layer_surface.initial_commit) return;
layer_surface.output.arrangeLayers();
}