Make Root a toplevel struct

This commit is contained in:
Isaac Freund 2020-05-02 16:44:46 +02:00
parent 9ea26d2a30
commit a73343c92f
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11
4 changed files with 197 additions and 201 deletions

View File

@ -8,7 +8,7 @@ const render = @import("render.zig");
const Box = @import("box.zig");
const LayerSurface = @import("layer_surface.zig");
const Log = @import("log.zig").Log;
const Root = @import("root.zig").Root;
const Root = @import("root.zig");
const View = @import("view.zig");
const ViewStack = @import("view_stack.zig").ViewStack;

View File

@ -1,19 +1,16 @@
const std = @import("std");
const c = @import("c.zig");
const util = @import("util.zig");
const Self = @This();
const std = @import("std");
const c = @import("c.zig");
const Box = @import("box.zig").Box;
const Log = @import("log.zig").Log;
const Output = @import("output.zig");
const Server = @import("server.zig");
const Seat = @import("seat.zig").Seat;
const View = @import("view.zig");
const ViewStack = @import("view_stack.zig").ViewStack;
/// Responsible for all windowing operations
pub const Root = struct {
const Self = @This();
server: *Server,
wlr_output_layout: *c.wlr_output_layout,
@ -150,11 +147,11 @@ pub const Root = struct {
}
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.", .{});
root.commitTransaction();
self.commitTransaction();
return 0;
}
@ -221,4 +218,3 @@ pub const Root = struct {
seat_node.data.focus(null);
}
}
};

View File

@ -9,7 +9,7 @@ const DecorationManager = @import("decoration_manager.zig");
const InputManager = @import("input_manager.zig");
const Log = @import("log.zig").Log;
const Output = @import("output.zig");
const Root = @import("root.zig").Root;
const Root = @import("root.zig");
const View = @import("view.zig");
const ViewStack = @import("view_stack.zig").ViewStack;

View File

@ -7,7 +7,7 @@ const c = @import("c.zig");
const Box = @import("box.zig");
const Log = @import("log.zig").Log;
const Output = @import("output.zig");
const Root = @import("root.zig").Root;
const Root = @import("root.zig");
const ViewStack = @import("view_stack.zig").ViewStack;
const XdgToplevel = @import("xdg_toplevel.zig");