almost there

This commit is contained in:
Harrison DiAmbrosio 2025-10-19 20:23:46 -04:00
parent 898342400e
commit cf7f397ed9
6 changed files with 63 additions and 19 deletions

View file

@ -11,7 +11,6 @@ const server = &@import("main.zig").server;
const gpa = std.heap.c_allocator;
scene: *wlr.Scene,
scene_tree: ?*wlr.SceneTree,
scene_output_layout: *wlr.SceneOutputLayout,
output_layout: *wlr.OutputLayout,
@ -29,11 +28,9 @@ pub fn init(self: *Root) !void {
self.* = .{
.scene = scene,
.scene_tree = null,
.output_layout = output_layout,
.scene_output_layout = try scene.attachOutputLayout(output_layout),
.all_views = try .initCapacity(gpa, 10),
};
}
@ -51,12 +48,12 @@ pub fn addOutput(self: *Root, new_output: *Output) void {
}
pub fn addView(self: *Root, view: *View) void {
self.all_views.append(gpa, view) catch {
std.log.err("Out of memory to append view", .{});
return;
};
// self.all_views.append(gpa, view) catch {
// std.log.err("Out of memory to append view", .{});
// return;
// };
self.scene_tree = self.scene.tree.createSceneXdgSurface(view.xdg_toplevel.base) catch {
view.scene_tree = self.scene.tree.createSceneXdgSurface(view.xdg_toplevel.base) catch {
std.log.err("Unable to create scene node for new view", .{});
_ = self.all_views.pop();