Make Root a toplevel struct
This commit is contained in:
parent
9ea26d2a30
commit
a73343c92f
@ -8,7 +8,7 @@ const render = @import("render.zig");
|
|||||||
const Box = @import("box.zig");
|
const Box = @import("box.zig");
|
||||||
const LayerSurface = @import("layer_surface.zig");
|
const LayerSurface = @import("layer_surface.zig");
|
||||||
const Log = @import("log.zig").Log;
|
const Log = @import("log.zig").Log;
|
||||||
const Root = @import("root.zig").Root;
|
const Root = @import("root.zig");
|
||||||
const View = @import("view.zig");
|
const View = @import("view.zig");
|
||||||
const ViewStack = @import("view_stack.zig").ViewStack;
|
const ViewStack = @import("view_stack.zig").ViewStack;
|
||||||
|
|
||||||
|
18
src/root.zig
18
src/root.zig
@ -1,19 +1,16 @@
|
|||||||
const std = @import("std");
|
const Self = @This();
|
||||||
const c = @import("c.zig");
|
|
||||||
const util = @import("util.zig");
|
const std = @import("std");
|
||||||
|
|
||||||
|
const c = @import("c.zig");
|
||||||
|
|
||||||
const Box = @import("box.zig").Box;
|
|
||||||
const Log = @import("log.zig").Log;
|
const Log = @import("log.zig").Log;
|
||||||
const Output = @import("output.zig");
|
const Output = @import("output.zig");
|
||||||
const Server = @import("server.zig");
|
const Server = @import("server.zig");
|
||||||
const Seat = @import("seat.zig").Seat;
|
|
||||||
const View = @import("view.zig");
|
const View = @import("view.zig");
|
||||||
const ViewStack = @import("view_stack.zig").ViewStack;
|
const ViewStack = @import("view_stack.zig").ViewStack;
|
||||||
|
|
||||||
/// Responsible for all windowing operations
|
/// Responsible for all windowing operations
|
||||||
pub const Root = struct {
|
|
||||||
const Self = @This();
|
|
||||||
|
|
||||||
server: *Server,
|
server: *Server,
|
||||||
|
|
||||||
wlr_output_layout: *c.wlr_output_layout,
|
wlr_output_layout: *c.wlr_output_layout,
|
||||||
@ -150,11 +147,11 @@ pub const Root = struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn handleTimeout(data: ?*c_void) callconv(.C) c_int {
|
fn handleTimeout(data: ?*c_void) callconv(.C) c_int {
|
||||||
const root = @ptrCast(*Root, @alignCast(@alignOf(*Root), data));
|
const self = @ptrCast(*Self, @alignCast(@alignOf(*Self), data));
|
||||||
|
|
||||||
Log.Error.log("Transaction timed out. Some imperfect frames may be shown.", .{});
|
Log.Error.log("Transaction timed out. Some imperfect frames may be shown.", .{});
|
||||||
|
|
||||||
root.commitTransaction();
|
self.commitTransaction();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -221,4 +218,3 @@ pub const Root = struct {
|
|||||||
seat_node.data.focus(null);
|
seat_node.data.focus(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
@ -9,7 +9,7 @@ const DecorationManager = @import("decoration_manager.zig");
|
|||||||
const InputManager = @import("input_manager.zig");
|
const InputManager = @import("input_manager.zig");
|
||||||
const Log = @import("log.zig").Log;
|
const Log = @import("log.zig").Log;
|
||||||
const Output = @import("output.zig");
|
const Output = @import("output.zig");
|
||||||
const Root = @import("root.zig").Root;
|
const Root = @import("root.zig");
|
||||||
const View = @import("view.zig");
|
const View = @import("view.zig");
|
||||||
const ViewStack = @import("view_stack.zig").ViewStack;
|
const ViewStack = @import("view_stack.zig").ViewStack;
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ const c = @import("c.zig");
|
|||||||
const Box = @import("box.zig");
|
const Box = @import("box.zig");
|
||||||
const Log = @import("log.zig").Log;
|
const Log = @import("log.zig").Log;
|
||||||
const Output = @import("output.zig");
|
const Output = @import("output.zig");
|
||||||
const Root = @import("root.zig").Root;
|
const Root = @import("root.zig");
|
||||||
const ViewStack = @import("view_stack.zig").ViewStack;
|
const ViewStack = @import("view_stack.zig").ViewStack;
|
||||||
const XdgToplevel = @import("xdg_toplevel.zig");
|
const XdgToplevel = @import("xdg_toplevel.zig");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user