Xwayland: create scene tree

This commit is contained in:
Isaac Freund 2023-02-01 22:46:03 +01:00
parent a545a06c5b
commit 1b57fe0aa7
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11

View File

@ -67,10 +67,9 @@ pub fn create(output: *Output, xwayland_surface: *wlr.XwaylandSurface) error{Out
const node = try util.gpa.create(ViewStack(View).Node);
const view = &node.view;
// TODO actually render xwayland windows, not just an empty tree.
const tree = try output.layers.views.createSceneTree();
view.init(output, tree, .{ .xwayland_view = .{
try view.init(output, tree, .{ .xwayland_view = .{
.view = view,
.xwayland_surface = xwayland_surface,
} });
@ -195,6 +194,13 @@ pub fn handleMap(listener: *wl.Listener(*wlr.XwaylandSurface), xwayland_surface:
xwayland_surface.events.request_fullscreen.add(&self.request_fullscreen);
xwayland_surface.events.request_minimize.add(&self.request_minimize);
const surface_tree = view.tree.createSceneSubsurfaceTree(surface) catch {
log.err("out of memory", .{});
surface.resource.getClient().postNoMemory();
return;
};
surface_tree.node.lowerToBottom();
// Use the view's "natural" size centered on the output as the default
// floating dimensions
view.float_box = .{