add logging to output.zig

This commit is contained in:
Squibid 2025-10-16 18:05:27 -04:00
parent 293a9e2d3e
commit 0f13973300
Signed by: squibid
GPG key ID: BECE5684D3C4005D

View file

@ -27,6 +27,8 @@ pub const Output = struct {
wlr_output.events.request_state.add(&output.request_state); wlr_output.events.request_state.add(&output.request_state);
wlr_output.events.destroy.add(&output.destroy); wlr_output.events.destroy.add(&output.destroy);
std.log.debug("adding output: {s}", .{output.*.wlr_output.*.name});
const layout_output = try server.output_layout.addAuto(wlr_output); const layout_output = try server.output_layout.addAuto(wlr_output);
const scene_output = try server.scene.createSceneOutput(wlr_output); const scene_output = try server.scene.createSceneOutput(wlr_output);
@ -49,12 +51,16 @@ pub const Output = struct {
) void { ) void {
const output: *Output = @fieldParentPtr("request_state", listener); const output: *Output = @fieldParentPtr("request_state", listener);
_ = output.wlr_output.commitState(event.state); if (!output.wlr_output.commitState(event.state)) {
std.log.warn("failed to set output state {}", .{event.state});
}
} }
pub fn handleDestroy(listener: *wl.Listener(*wlr.Output), _: *wlr.Output) void { pub fn handleDestroy(listener: *wl.Listener(*wlr.Output), _: *wlr.Output) void {
const output: *Output = @fieldParentPtr("destroy", listener); const output: *Output = @fieldParentPtr("destroy", listener);
std.log.debug("removing output: {s}", .{output.*.wlr_output.*.name});
output.frame.link.remove(); output.frame.link.remove();
output.request_state.link.remove(); output.request_state.link.remove();
output.destroy.link.remove(); output.destroy.link.remove();