diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-05-11 13:46:29 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-05-11 13:46:29 +0200 |
| commit | b2f172e91b2d75b0b2af02621ab302afce3a94d6 (patch) | |
| tree | 92b3df95d2eb6d8ebb347f9001a6aaa8f15582e1 /src/Server.zig | |
| parent | 26cced20d9ee31390a7bae5210eb8ec3f7e69b98 (diff) | |
| download | river-b2f172e91b2d75b0b2af02621ab302afce3a94d6.tar.gz river-b2f172e91b2d75b0b2af02621ab302afce3a94d6.tar.xz | |
Implement xwayland unmanaged windows
Diffstat (limited to 'src/Server.zig')
| -rw-r--r-- | src/Server.zig | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Server.zig b/src/Server.zig index b617b04..944f297 100644 --- a/src/Server.zig +++ b/src/Server.zig @@ -30,6 +30,7 @@ const Output = @import("Output.zig"); const Root = @import("Root.zig"); const View = @import("View.zig"); const ViewStack = @import("view_stack.zig").ViewStack; +const XwaylandUnmanaged = @import("XwaylandUnmanaged.zig"); allocator: *std.mem.Allocator, @@ -105,7 +106,7 @@ pub fn init(self: *Self, allocator: *std.mem.Allocator) !void { self.listen_new_layer_surface.notify = handleNewLayerSurface; c.wl_signal_add(&self.wlr_layer_shell.events.new_surface, &self.listen_new_layer_surface); - // Set up xwayland if built with suport + // Set up xwayland if built with support if (build_options.xwayland) { self.wlr_xwayland = c.wlr_xwayland_create(self.wl_display, wlr_compositor, false) orelse return error.CantCreateWlrXwayland; @@ -247,6 +248,15 @@ fn handleNewXwaylandSurface(listener: ?*c.wl_listener, data: ?*c_void) callconv( @alignCast(@alignOf(*c.wlr_xwayland_surface), data), ); + if (wlr_xwayland_surface.override_redirect) { + Log.Debug.log("New unmanaged xwayland surface", .{}); + // The unmanged surface will add itself to the list of unmanaged views + // in Root when it is mapped. + const node = self.allocator.create(std.TailQueue(XwaylandUnmanaged).Node) catch unreachable; + node.data.init(&self.root, wlr_xwayland_surface); + return; + } + Log.Debug.log( "New xwayland surface: title '{}', class '{}'", .{ wlr_xwayland_surface.title, wlr_xwayland_surface.class }, |
