This commit is contained in:
Harrison DiAmbrosio 2025-10-18 20:51:15 -04:00
parent 275f96615b
commit b67b3a6ec9
2 changed files with 14 additions and 9 deletions

View file

@ -31,11 +31,16 @@ pub const Output = struct {
} }
pub fn handleFrame(_: *wl.Listener(*wlr.Output), wlr_output: *wlr.Output) void { pub fn handleFrame(_: *wl.Listener(*wlr.Output), wlr_output: *wlr.Output) void {
const scene_output = server.scene.getSceneOutput(wlr_output).?; const scene_output = server.scene.getSceneOutput(wlr_output);
_ = scene_output.commit(null);
if(scene_output) |so| {
std.log.info("Rendering commitin scene output\n", .{});
_ = so.commit(null);
var now = posix.clock_gettime(posix.CLOCK.MONOTONIC) catch @panic("CLOCK_MONOTONIC not supported");
so.sendFrameDone(&now);
}
var now = posix.clock_gettime(posix.CLOCK.MONOTONIC) catch @panic("CLOCK_MONOTONIC not supported");
scene_output.sendFrameDone(&now);
} }
pub fn handleRequestState( pub fn handleRequestState(

View file

@ -15,7 +15,7 @@ pub const Root = struct {
new_output: wl.Listener(*wlr.Output), new_output: wl.Listener(*wlr.Output),
pub fn init(root: *Root) !void { pub fn init(root: *Root) !void {
std.log.info("Creating root of mezzaluna", .{}); std.log.info("Creating root of mezzaluna\n", .{});
const output_layout = try wlr.OutputLayout.create(server.wl_server); const output_layout = try wlr.OutputLayout.create(server.wl_server);
errdefer output_layout.destroy(); errdefer output_layout.destroy();
@ -39,10 +39,10 @@ pub const Root = struct {
return; return;
}; };
_ = self.scene.createSceneOutput(new_output.wlr_output) catch { // _ = self.scene.createSceneOutput(new_output.wlr_output) catch {
std.log.err("failed to create scene output for new output", .{}); // std.log.err("failed to create scene output for new output", .{});
return; // return;
}; // };
} }
}; };