mirror of
https://github.com/MezzalunaWM/Mezzaluna.git
synced 2026-03-08 04:57:32 -04:00
almost there
This commit is contained in:
parent
898342400e
commit
cf7f397ed9
6 changed files with 63 additions and 19 deletions
13
src/root.zig
13
src/root.zig
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue