Skip to content

Commit

Permalink
Fix weird alt-tab edge case.
Browse files Browse the repository at this point in the history
  • Loading branch information
WINSDK committed Apr 17, 2024
1 parent ab07f1c commit 798fc7a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gui/src/panels/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,16 @@ impl Panels {
None => continue,
};

let mut active_idx = active_tab.0 as usize;
for child in tabs.children.iter() {
let mut active_idx = 0;
for (idx, child) in tabs.children.iter().enumerate() {
if *child == active_tab {
active_idx = child.0 as usize;
active_idx = idx;
}
}

let next_id = (active_idx + 1) % (tabs.children.len() + 1);
tabs.set_active(TileId(next_id as u64));
let next_idx = (active_idx + 1) % (tabs.children.len());
let next_id = tabs.children[next_idx];
tabs.set_active(next_id);
break;
}
}
Expand Down

0 comments on commit 798fc7a

Please sign in to comment.