mirror of
https://gitlab.com/hyask/swaysome.git
synced 2025-12-10 07:44:43 +01:00
parent
df9b26335f
commit
c5930274e5
1 changed files with 13 additions and 2 deletions
15
src/main.rs
15
src/main.rs
|
|
@ -652,11 +652,22 @@ impl SwaySome {
|
||||||
let current_workspace_index: usize = self.get_current_workspace_index();
|
let current_workspace_index: usize = self.get_current_workspace_index();
|
||||||
let focused_group_index = current_workspace_index / MAX_GROUP_WS;
|
let focused_group_index = current_workspace_index / MAX_GROUP_WS;
|
||||||
|
|
||||||
|
let highest_group = self.workspaces.last().unwrap().num / MAX_GROUP_WS;
|
||||||
|
let target_group;
|
||||||
if go_to_prev {
|
if go_to_prev {
|
||||||
self.focus_to_group(focused_group_index - 1);
|
if focused_group_index == 0 {
|
||||||
|
target_group = highest_group;
|
||||||
} else {
|
} else {
|
||||||
self.focus_to_group(focused_group_index + 1);
|
target_group = focused_group_index - 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if focused_group_index >= highest_group {
|
||||||
|
target_group = 0;
|
||||||
|
} else {
|
||||||
|
target_group = focused_group_index + 1;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
self.focus_to_group(target_group);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn init_workspaces(&self, workspace_index: usize) {
|
fn init_workspaces(&self, workspace_index: usize) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue