mirror of
https://gitlab.com/hyask/swaysome.git
synced 2025-12-10 07:44:43 +01:00
Check group index lower limit
This commit is contained in:
parent
1234264d75
commit
0db1faa1c5
1 changed files with 2 additions and 1 deletions
|
|
@ -413,6 +413,7 @@ fn focus_to_group(stream: &UnixStream, group_index: usize) {
|
|||
current_workspace_index - (current_workspace_index / 10) * 10;
|
||||
|
||||
let target_workspace_index = group_index * 10 + contextual_target_workspace_index;
|
||||
println!("{target_workspace_index}");
|
||||
|
||||
// If the workspace already exists
|
||||
match workspaces.iter().find(|w| w.num == target_workspace_index) {
|
||||
|
|
@ -435,7 +436,7 @@ fn focus_to_group(stream: &UnixStream, group_index: usize) {
|
|||
),
|
||||
None => {
|
||||
// Or if the targeted output is currently connected
|
||||
if group_index <= outputs.len() {
|
||||
if group_index != 0 && group_index <= outputs.len() {
|
||||
Some(group_index)
|
||||
} else {
|
||||
None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue