mirror of
https://github.com/wizbright/waybox.git
synced 2025-10-29 05:40:20 -04:00
Don't focus a toplevel if a layer is focused
Previously, it would focus the toplevel and then focus would return to the layer, but now focusing the toplevel is skipped.
This commit is contained in:
parent
b274485c9c
commit
fa36852a58
1 changed files with 6 additions and 4 deletions
|
|
@ -41,10 +41,14 @@ void focus_toplevel(struct wb_toplevel *toplevel, struct wlr_surface *surface) {
|
|||
xdg_surface->toplevel->app_id);
|
||||
|
||||
struct wb_server *server = toplevel->server;
|
||||
if (server->seat->focused_layer != NULL) {
|
||||
/* If a layer is focused, don't focus a toplevel. */
|
||||
return;
|
||||
}
|
||||
struct wlr_seat *seat = server->seat->seat;
|
||||
struct wlr_surface *prev_surface = seat->keyboard_state.focused_surface;
|
||||
if (prev_surface == surface) {
|
||||
/* Don't re-focus an already focused surface. */
|
||||
/* Don't focus a surface that's already focused. */
|
||||
return;
|
||||
}
|
||||
if (prev_surface != NULL) {
|
||||
|
|
@ -60,9 +64,7 @@ void focus_toplevel(struct wb_toplevel *toplevel, struct wlr_surface *surface) {
|
|||
}
|
||||
}
|
||||
/* Move the toplevel to the front */
|
||||
if (!server->seat->focused_layer) {
|
||||
wlr_scene_node_raise_to_top(&toplevel->scene_tree->node);
|
||||
}
|
||||
wlr_scene_node_raise_to_top(&toplevel->scene_tree->node);
|
||||
wl_list_remove(&toplevel->link);
|
||||
wl_list_insert(&server->toplevels, &toplevel->link);
|
||||
/* Activate the new surface */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue