aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Krzyszkowiak <dos@dosowisko.net>2019-07-11 01:42:43 +0200
committerDrew DeVault <sir@cmpwn.com>2019-07-11 12:31:21 -0400
commit6345000b929293a2917a1a08a6d2751020d36e3c (patch)
tree19d90b8124191f9a76d5871a7f6bd273c1e65da0
parentdf3f0ffbb0bcce8a12c83b577fd688a4ec290e7e (diff)
seat: Move focus back to first shell surface when unfocusing layer surface
-rw-r--r--rootston/seat.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/rootston/seat.c b/rootston/seat.c
index bd15a1b0..719fc352 100644
--- a/rootston/seat.c
+++ b/rootston/seat.c
@@ -1441,7 +1441,15 @@ void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view) {
void roots_seat_set_focus_layer(struct roots_seat *seat,
struct wlr_layer_surface_v1 *layer) {
if (!layer) {
- seat->focused_layer = NULL;
+ if (seat->focused_layer) {
+ seat->focused_layer = NULL;
+ if (!wl_list_empty(&seat->views)) {
+ // Focus first view
+ struct roots_seat_view *first_seat_view = wl_container_of(
+ seat->views.next, first_seat_view, link);
+ roots_seat_set_focus(seat, first_seat_view->view);
+ }
+ }
return;
}
struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->seat);