aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <mail@isaacfreund.com>2023-02-01 22:46:03 +0100
committerIsaac Freund <mail@isaacfreund.com>2023-02-28 14:55:58 +0100
commit1b57fe0aa747f7b6a5d421ef9eae1eb1ed2af6af (patch)
tree4595b764e8b9575502fa5fd15b9b1726123a5281
parenta545a06c5b2eab76adb4b0009ee24fc69fbae0f2 (diff)
downloadriver-1b57fe0aa747f7b6a5d421ef9eae1eb1ed2af6af.tar.gz
river-1b57fe0aa747f7b6a5d421ef9eae1eb1ed2af6af.tar.xz
Xwayland: create scene tree
-rw-r--r--river/XwaylandView.zig10
1 files changed, 8 insertions, 2 deletions
diff --git a/river/XwaylandView.zig b/river/XwaylandView.zig
index 211a8a8..7ae257c 100644
--- a/river/XwaylandView.zig
+++ b/river/XwaylandView.zig
@@ -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 = .{