session lock: focus keyboard on lock surface

Swaylock needs keyboard focus to receive password input.
This commit is contained in:
lkn 2026-06-23 22:45:49 +02:00
parent daa08d23aa
commit 9e91722e02
1 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,7 @@
#include <wlr/types/wlr_session_lock_v1.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_seat.h>
#include "wl_types.h"
static void handle_lock_new_surface(struct wl_listener *listener, void *data)
@ -23,6 +24,11 @@ static void handle_lock_new_surface(struct wl_listener *listener, void *data)
struct wlr_scene_tree *parent = wl_state.level_trees[WL_LAYER_OVERLAY]
? wl_state.level_trees[WL_LAYER_OVERLAY] : &wl_state.scene->tree;
wlr_scene_subsurface_tree_create(parent, lock_surface->surface);
/* Give keyboard focus to the lock surface */
if (wl_state.seat)
wlr_seat_keyboard_notify_enter(wl_state.seat, lock_surface->surface,
NULL, 0, NULL);
}
static void handle_lock_unlock(struct wl_listener *listener, void *data)