shell: Give keyboard focus to top surface when current keyboard focus goes away
This commit is contained in:
+16
@@ -385,10 +385,26 @@ focus_state_surface_destroy(struct wl_listener *listener, void *data)
|
|||||||
struct focus_state *state = container_of(listener,
|
struct focus_state *state = container_of(listener,
|
||||||
struct focus_state,
|
struct focus_state,
|
||||||
surface_destroy_listener);
|
surface_destroy_listener);
|
||||||
|
struct desktop_shell *shell;
|
||||||
|
struct weston_surface *surface, *next;
|
||||||
|
|
||||||
|
next = NULL;
|
||||||
|
wl_list_for_each(surface, &state->ws->layer.surface_list, layer_link) {
|
||||||
|
if (surface == state->keyboard_focus)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
next = surface;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (next) {
|
||||||
|
shell = state->seat->compositor->shell_interface.shell;
|
||||||
|
activate(shell, next, state->seat);
|
||||||
|
} else {
|
||||||
wl_list_remove(&state->link);
|
wl_list_remove(&state->link);
|
||||||
focus_state_destroy(state);
|
focus_state_destroy(state);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static struct focus_state *
|
static struct focus_state *
|
||||||
focus_state_create(struct weston_seat *seat, struct workspace *ws)
|
focus_state_create(struct weston_seat *seat, struct workspace *ws)
|
||||||
|
|||||||
Reference in New Issue
Block a user