mirror of
https://gitlab.com/hyask/swaysome.git
synced 2026-01-28 02:17:18 +01:00
Fix focus to group when no existing workspace
This commit is contained in:
parent
72c34cb5e5
commit
4ec989ed72
1 changed files with 3 additions and 3 deletions
|
|
@ -434,7 +434,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 <= outputs.len() {
|
||||
Some(group_index)
|
||||
} else {
|
||||
None
|
||||
|
|
@ -445,7 +445,7 @@ fn focus_to_group(stream: &UnixStream, group_index: usize) {
|
|||
match target_screen_index {
|
||||
// If we have to send it to another screen
|
||||
Some(target_screen_index) => {
|
||||
let target_output = &outputs[target_screen_index];
|
||||
let target_output = &outputs[target_screen_index - 1];
|
||||
|
||||
let mut focus_cmd: String = "focus output ".to_string();
|
||||
focus_cmd.push_str(&target_output.name);
|
||||
|
|
@ -565,7 +565,7 @@ fn rearrange_workspaces(stream: &UnixStream) {
|
|||
send_command(stream, &focus_cmd);
|
||||
|
||||
let output_index = workspace.num / 10;
|
||||
if output_index < outputs.len() {
|
||||
if output_index <= outputs.len() {
|
||||
let mut move_cmd = move_cmd_prefix.clone();
|
||||
move_cmd.push_str(&outputs[output_index - 1].name);
|
||||
send_command(stream, &move_cmd);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue