mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Merge pull request #2433 from RyanDwyer/fix-sticky-infinite-loop
Fix infinite loop when focusing sticky containers via workspace command
This commit is contained in:
commit
84845adb8e
1 changed files with 13 additions and 10 deletions
|
@ -411,17 +411,20 @@ bool workspace_switch(struct sway_container *workspace,
|
||||||
struct sway_container *floating =
|
struct sway_container *floating =
|
||||||
next_output_prev_ws->sway_workspace->floating;
|
next_output_prev_ws->sway_workspace->floating;
|
||||||
bool has_sticky = false;
|
bool has_sticky = false;
|
||||||
for (int i = 0; i < floating->children->length; ++i) {
|
if (workspace != next_output_prev_ws) {
|
||||||
struct sway_container *floater = floating->children->items[i];
|
for (int i = 0; i < floating->children->length; ++i) {
|
||||||
if (floater->is_sticky) {
|
struct sway_container *floater = floating->children->items[i];
|
||||||
has_sticky = true;
|
if (floater->is_sticky) {
|
||||||
container_remove_child(floater);
|
has_sticky = true;
|
||||||
container_add_child(workspace->sway_workspace->floating, floater);
|
container_remove_child(floater);
|
||||||
if (floater == focus) {
|
container_add_child(workspace->sway_workspace->floating,
|
||||||
seat_set_focus(seat, NULL);
|
floater);
|
||||||
seat_set_focus(seat, floater);
|
if (floater == focus) {
|
||||||
|
seat_set_focus(seat, NULL);
|
||||||
|
seat_set_focus(seat, floater);
|
||||||
|
}
|
||||||
|
--i;
|
||||||
}
|
}
|
||||||
--i;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue