git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit24d45b12f0a05a6b2b0e4e7782772041013d9f69
parent6db9c3802f
authorIsaac Freund <[email protected]>
date2023-03-06 20:17
Seat: fix potential assertion failure

 river/Seat.zig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/river/Seat.zig b/river/Seat.zig
index 685d4cc..5b5075f 100644
--- a/river/Seat.zig
+++ b/river/Seat.zig
@@ -160,7 +160,9 @@ pub fn focus(self: *Self, _target: ?*View) void {
     }
 
     if (target) |view| {
-        if (view.pending.tags & view.pending.output.?.pending.tags == 0) {
+        if (view.pending.output == null or
+            view.pending.tags & view.pending.output.?.pending.tags == 0)
+        {
             // If the view is not currently visible, behave as if null was passed
             target = null;
         } else if (view.pending.output.? != self.focused_output.?) {