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 => {
|
None => {
|
||||||
// Or if the targeted output is currently connected
|
// Or if the targeted output is currently connected
|
||||||
if group_index < outputs.len() {
|
if group_index <= outputs.len() {
|
||||||
Some(group_index)
|
Some(group_index)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|
@ -445,7 +445,7 @@ fn focus_to_group(stream: &UnixStream, group_index: usize) {
|
||||||
match target_screen_index {
|
match target_screen_index {
|
||||||
// If we have to send it to another screen
|
// If we have to send it to another screen
|
||||||
Some(target_screen_index) => {
|
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();
|
let mut focus_cmd: String = "focus output ".to_string();
|
||||||
focus_cmd.push_str(&target_output.name);
|
focus_cmd.push_str(&target_output.name);
|
||||||
|
|
@ -565,7 +565,7 @@ fn rearrange_workspaces(stream: &UnixStream) {
|
||||||
send_command(stream, &focus_cmd);
|
send_command(stream, &focus_cmd);
|
||||||
|
|
||||||
let output_index = workspace.num / 10;
|
let output_index = workspace.num / 10;
|
||||||
if output_index < outputs.len() {
|
if output_index <= outputs.len() {
|
||||||
let mut move_cmd = move_cmd_prefix.clone();
|
let mut move_cmd = move_cmd_prefix.clone();
|
||||||
move_cmd.push_str(&outputs[output_index - 1].name);
|
move_cmd.push_str(&outputs[output_index - 1].name);
|
||||||
send_command(stream, &move_cmd);
|
send_command(stream, &move_cmd);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue