From db366e9455d73a026e321966c07beeb525c4584a Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Fri, 24 Jun 2022 12:05:54 +0200 Subject: [PATCH] Xwayland: fix View.fromWlrSurface for OR surfaces --- river/View.zig | 2 +- river/XwaylandOverrideRedirect.zig | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/river/View.zig b/river/View.zig index 16d6036..e0961eb 100644 --- a/river/View.zig +++ b/river/View.zig @@ -430,7 +430,7 @@ pub fn fromWlrSurface(surface: *wlr.Surface) ?*Self { if (build_options.xwayland) { if (surface.isXWaylandSurface()) { const xwayland_surface = wlr.XwaylandSurface.fromWlrSurface(surface); - return @intToPtr(*Self, xwayland_surface.data); + return @intToPtr(?*Self, xwayland_surface.data); } } if (surface.isSubsurface()) { diff --git a/river/XwaylandOverrideRedirect.zig b/river/XwaylandOverrideRedirect.zig index 77cd74b..3436c4e 100644 --- a/river/XwaylandOverrideRedirect.zig +++ b/river/XwaylandOverrideRedirect.zig @@ -53,6 +53,8 @@ pub fn create(xwayland_surface: *wlr.XwaylandSurface) error{OutOfMemory}!*Self { const self = &node.data; self.* = .{ .xwayland_surface = xwayland_surface }; + // This must be set to 0 for usage in View.fromWlrSurface() + xwayland_surface.data = 0; // Add listeners that are active over the the entire lifetime xwayland_surface.events.request_configure.add(&self.request_configure);