aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-04-03 15:42:32 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-04-04 18:47:48 -0400
commit3ede718c06194651146f05de4d8889620b159f87 (patch)
tree481144a57e747146cbf2a82eb17bee510a8036b3
parentActually let's not do that TODO (diff)
downloadsway-3ede718c06194651146f05de4d8889620b159f87.tar.gz
sway-3ede718c06194651146f05de4d8889620b159f87.tar.zst
sway-3ede718c06194651146f05de4d8889620b159f87.zip
Refocus the last focused container on lock exit
-rw-r--r--sway/input/seat.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index 4a99e9eb..a6b42598 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -424,11 +424,18 @@ void seat_set_focus(struct sway_seat *seat,
424 424
425void seat_set_focus_layer(struct sway_seat *seat, 425void seat_set_focus_layer(struct sway_seat *seat,
426 struct wlr_layer_surface *layer) { 426 struct wlr_layer_surface *layer) {
427 if (!layer) { 427 if (!layer && seat->focused_layer) {
428 seat->focused_layer = NULL; 428 seat->focused_layer = NULL;
429 struct sway_container *c = seat_get_focus(seat);
430 if (c) {
431 wlr_log(L_DEBUG, "Returning focus to %p %s '%s'", c,
432 container_type_to_str(c->type), c->name);
433 // Hack to get seat to re-focus the return value of get_focus
434 seat_set_focus(seat, c->parent);
435 seat_set_focus(seat, c);
436 }
429 return; 437 return;
430 } 438 } else if (!layer || seat->focused_layer == layer) {
431 if (seat->focused_layer == layer) {
432 return; 439 return;
433 } 440 }
434 if (seat->has_focus) { 441 if (seat->has_focus) {