From e1ab51f26071958bbeb2d0c637d3d00eb4326fdf Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Fri, 10 Feb 2023 13:12:11 +0100 Subject: [PATCH] Seat: guard setFocusRaw() usage while locked Focusing a layer shell or Xwayland override redirect surface while locked is a bug. --- river/Output.zig | 2 ++ river/XwaylandOverrideRedirect.zig | 2 ++ 2 files changed, 4 insertions(+) diff --git a/river/Output.zig b/river/Output.zig index f994190..b654193 100644 --- a/river/Output.zig +++ b/river/Output.zig @@ -293,6 +293,8 @@ pub fn arrangeLayers(self: *Self, target: ArrangeLayersTarget) void { if (target == .unmapped) return; + if (server.lock_manager.state != .unlocked) return; + // Find the topmost layer surface in the top or overlay layers which // requests keyboard interactivity if any. const topmost_surface = outer: for (layers[0..2]) |layer| { diff --git a/river/XwaylandOverrideRedirect.zig b/river/XwaylandOverrideRedirect.zig index 224ad65..ad604ba 100644 --- a/river/XwaylandOverrideRedirect.zig +++ b/river/XwaylandOverrideRedirect.zig @@ -101,6 +101,8 @@ pub fn handleMap(listener: *wl.Listener(*wlr.XwaylandSurface), xwayland_surface: } pub fn focusIfDesired(self: *Self) void { + if (server.lock_manager.state != .unlocked) return; + if (self.xwayland_surface.overrideRedirectWantsFocus() and self.xwayland_surface.icccmInputModel() != .none) {