mirror of
https://github.com/MezzalunaWM/Mezzaluna.git
synced 2026-03-09 13:07:32 -04:00
basic data retrieval output api and some more view api
This commit is contained in:
parent
d4ab71fb35
commit
d34db37589
11 changed files with 272 additions and 72 deletions
16
src/root.zig
16
src/root.zig
|
|
@ -67,11 +67,17 @@ pub fn viewById(self: *Root, id: u64) ?*View {
|
|||
return null;
|
||||
}
|
||||
|
||||
pub fn addOutput(self: *Root, new_output: *Output) void {
|
||||
errdefer Utils.oomPanic();
|
||||
const layout_output = try self.output_layout.addAuto(new_output.wlr_output);
|
||||
self.scene_output_layout.addOutput(layout_output, new_output.scene_output);
|
||||
server.seat.focusOutput(new_output);
|
||||
pub fn outputById(self: *Root, id: u64) ?*Output {
|
||||
var it = self.scene.outputs.iterator(.forward);
|
||||
|
||||
while(it.next()) |scene_output| {
|
||||
if(scene_output.output.data == null) continue;
|
||||
|
||||
const output: *Output = @as(*Output, @ptrCast(@alignCast(scene_output.output.data.?)));
|
||||
if(output.id == id) return output;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
const ViewAtResult = struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue