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

commitb1d5e9938479698edbed75f0f2a36bd5b7a2de35
parent729d5716d3
authorIsaac Freund <[email protected]>
date2026-04-22 08:29
LayerSurface: check keyboard_interactivity before focusing

Actually check for on_demand keyboard_interactivity before granting
non_exclusive focus on click.

Reported-by: eloc

 river/Cursor.zig | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/river/Cursor.zig b/river/Cursor.zig
index 00f3cde..d8c1744 100644
--- a/river/Cursor.zig
+++ b/river/Cursor.zig
@@ -624,10 +624,12 @@ fn interact(cursor: Cursor, result: Scene.AtResult) void {
         .layer_surface => |layer_surface| {
             switch (cursor.seat.layer_shell.scheduled.focus) {
                 .none, .non_exclusive => {
-                    cursor.seat.layer_shell.scheduled.focus = .{
-                        .non_exclusive = layer_surface.ref,
-                    };
-                    server.wm.dirtyWindowing();
+                    if (layer_surface.wlr_layer_surface.current.keyboard_interactive == .on_demand) {
+                        cursor.seat.layer_shell.scheduled.focus = .{
+                            .non_exclusive = layer_surface.ref,
+                        };
+                        server.wm.dirtyWindowing();
+                    }
                 },
                 .exclusive => {},
             }