mirror of
https://github.com/MezzalunaWM/Mezzaluna.git
synced 2026-03-07 19:49:53 -05:00
add logging to output.zig
This commit is contained in:
parent
293a9e2d3e
commit
0f13973300
1 changed files with 7 additions and 1 deletions
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue