aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <mail@isaacfreund.com>2022-07-01 20:53:45 +0200
committerIsaac Freund <mail@isaacfreund.com>2022-07-01 20:53:45 +0200
commit7402cb8aea2d4fab6fdf3cd29ce7130f553ff9f0 (patch)
treee3dd8527c4eaf0bb3b20873fe385f8812bcdf206
parentdb366e9455d73a026e321966c07beeb525c4584a (diff)
downloadriver-7402cb8aea2d4fab6fdf3cd29ce7130f553ff9f0.tar.gz
river-7402cb8aea2d4fab6fdf3cd29ce7130f553ff9f0.tar.xz
deps: update to latest zig-wlroots
This fixes the return type of Foo.fromWlrSurface() functions which can in fact return null in the edge case that the role matches but the corresponding object has already been destroyed.
m---------deps/zig-wlroots0
-rw-r--r--river/View.zig10
2 files changed, 4 insertions, 6 deletions
diff --git a/deps/zig-wlroots b/deps/zig-wlroots
-Subproject 597b2448319caa90ebe3625dd03ce925dee08b1
+Subproject 06297208176ac530b4882c92d6b064bda467c00
diff --git a/river/View.zig b/river/View.zig
index e0961eb..d344638 100644
--- a/river/View.zig
+++ b/river/View.zig
@@ -422,16 +422,14 @@ pub fn move(self: *Self, delta_x: i32, delta_y: i32) void {
/// Find and return the view corresponding to a given surface, if any
pub fn fromWlrSurface(surface: *wlr.Surface) ?*Self {
if (surface.isXdgSurface()) {
- const xdg_surface = wlr.XdgSurface.fromWlrSurface(surface);
+ const xdg_surface = wlr.XdgSurface.fromWlrSurface(surface) orelse return null;
if (xdg_surface.role == .toplevel) {
return @intToPtr(*Self, xdg_surface.data);
}
}
- if (build_options.xwayland) {
- if (surface.isXWaylandSurface()) {
- const xwayland_surface = wlr.XwaylandSurface.fromWlrSurface(surface);
- return @intToPtr(?*Self, xwayland_surface.data);
- }
+ if (build_options.xwayland and surface.isXWaylandSurface()) {
+ const xwayland_surface = wlr.XwaylandSurface.fromWlrSurface(surface) orelse return null;
+ return @intToPtr(?*Self, xwayland_surface.data);
}
if (surface.isSubsurface()) {
if (wlr.Subsurface.fromWlrSurface(surface)) |ss| {