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);