mirror of
https://github.com/swaywm/sway.git
synced 2026-07-05 00:06:04 -04:00
layer_shell: fix reversed precedence check in handle_map
When a new layer surface maps, Sway determines if it should steal focus by comparing its layer level against the currently focused layer. The previous check used `focused >= new` to determine whether to switch focus to new, which allowed lower precedence layers to steal focus from higher ones. This latent issue was masked by arrange_layers() coming through and fixing up the focus state afterwards. However it resulted in a focus "flicker" where layer-shell surfaces briefly lost focus before having it restored again almost immediately. This commit changes the comparison to `<=` so that lower precedence surfaces do not steal focus from higher precedence surfaces, and there is no focus flicker.
This commit is contained in:
parent
ce72f66c58
commit
cff7a88bda
1 changed files with 1 additions and 1 deletions
|
|
@ -291,7 +291,7 @@ static void handle_map(struct wl_listener *listener, void *data) {
|
|||
wl_list_for_each(seat, &server.input->seats, link) {
|
||||
// but only if the currently focused layer has a lower precedence
|
||||
if (!seat->focused_layer ||
|
||||
seat->focused_layer->current.layer >= layer_surface->current.layer) {
|
||||
seat->focused_layer->current.layer <= layer_surface->current.layer) {
|
||||
seat_set_focus_layer(seat, layer_surface);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue