mirror of
https://github.com/swaywm/sway.git
synced 2025-10-08 13:16:05 +00:00
Initially focus the lock surface that has the current output focus
This commit is contained in:
parent
f769203238
commit
1737a58b01
1 changed files with 10 additions and 1 deletions
11
sway/lock.c
11
sway/lock.c
|
@ -8,6 +8,7 @@
|
|||
#include "sway/layers.h"
|
||||
#include "sway/output.h"
|
||||
#include "sway/server.h"
|
||||
#include "sway/tree/workspace.h"
|
||||
#include "sway/lock.h"
|
||||
|
||||
struct sway_session_lock_output {
|
||||
|
@ -78,7 +79,15 @@ void sway_session_lock_focus_output(struct sway_session_lock *lock,
|
|||
|
||||
static void handle_surface_map(struct wl_listener *listener, void *data) {
|
||||
struct sway_session_lock_output *surf = wl_container_of(listener, surf, surface_map);
|
||||
if (surf->lock->focused == NULL) {
|
||||
|
||||
struct sway_seat *seat = input_manager_current_seat();
|
||||
struct sway_workspace *focused_ws = seat_get_focused_workspace(seat);
|
||||
struct sway_output *focused_output = NULL;
|
||||
if (focused_ws != NULL) {
|
||||
focused_output = focused_ws->output;
|
||||
}
|
||||
|
||||
if (surf->lock->focused == NULL || focused_output == surf->output) {
|
||||
focus_surface(surf->lock, surf->surface->surface);
|
||||
}
|
||||
cursor_rebase_all();
|
||||
|
|
Loading…
Add table
Reference in a new issue