From b2f172e91b2d75b0b2af02621ab302afce3a94d6 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Mon, 11 May 2020 13:46:29 +0200 Subject: Implement xwayland unmanaged windows --- src/Server.zig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/Server.zig') 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 }, -- cgit v1.2.3