layer: move the "locked" check to seat_force_focus_surface()

This commit is contained in:
Johan Malm 2026-02-18 21:28:56 +00:00 committed by Johan Malm
parent a277c35c3d
commit 00ad5a03f2
2 changed files with 4 additions and 3 deletions

View file

@ -23,7 +23,6 @@
#include "labwc.h"
#include "node.h"
#include "output.h"
#include "session-lock.h"
#define LAB_LAYERSHELL_VERSION 4
@ -521,12 +520,11 @@ handle_popup_commit(struct wl_listener *listener, void *data)
/* Force focus when popup was triggered by IPC */
struct server *server = popup->server;
struct seat *seat = &server->seat;
bool locked = server->session_lock_manager->locked;
if (seat->seat->keyboard_state.focused_surface
== popup->wlr_popup->parent) {
popup->parent_was_focused = true;
}
if (!locked && popup->wlr_popup->seat) {
if (popup->wlr_popup->seat) {
struct wlr_layer_surface_v1 *layer_surface =
popup->lab_layer_surface->layer_surface;
seat_force_focus_surface(seat, layer_surface->surface);

View file

@ -762,6 +762,9 @@ seat_reconfigure(struct server *server)
void
seat_force_focus_surface(struct seat *seat, struct wlr_surface *surface)
{
if (seat->server->session_lock_manager->locked) {
return;
}
uint32_t *pressed_sent_keycodes = key_state_pressed_sent_keycodes();
int nr_pressed_sent_keycodes = key_state_nr_pressed_sent_keycodes();
struct wlr_keyboard *kb = &seat->keyboard_group->keyboard;