Skip to content

Commit

Permalink
koekeishiya#181 return a non-zero exit code when 'space --focus ..' f…
Browse files Browse the repository at this point in the history
…ails because of the scripting addition
  • Loading branch information
Åsmund Vikane authored and unrevre committed Nov 12, 2020
1 parent 5d8c9bd commit 5cb2530
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased]
### Changed
- Update scripting-addition to support macOS Big Sur 11.0 Build 20A5384c [#589](https://github.com/koekeishiya/yabai/issues/589)
- Return a non-zero exit code when focusing a space fails due to an issue with the scripting-addition [#181](https://github.com/koekeishiya/yabai/issues/181)

## [3.3.0] - 2020-09-03
### Added
Expand Down
2 changes: 2 additions & 0 deletions src/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,8 @@ static void handle_domain_space(FILE *rsp, struct token domain, char *message)
daemon_fail(rsp, "cannot focus space because the display is in the middle of an animation.\n");
} else if (result == SPACE_OP_ERROR_IN_MISSION_CONTROL) {
daemon_fail(rsp, "cannot focus space because mission-control is active.\n");
} else {
daemon_fail(rsp, "cannot focus space due to an error with the scripting-addition.\n");
}
}
} else if (token_equals(command, COMMAND_SPACE_MOVE)) {
Expand Down
2 changes: 2 additions & 0 deletions src/space_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,8 @@ enum space_op_error space_manager_focus_space(uint64_t sid)

if (scripting_addition_focus_space(sid)) {
if (focus_display) display_manager_focus_display(new_did);
} else {
return SPACE_OP_ERROR_SCRIPTING_ADDITION;
}

return SPACE_OP_ERROR_SUCCESS;
Expand Down
1 change: 1 addition & 0 deletions src/space_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ enum space_op_error
SPACE_OP_ERROR_SAME_DISPLAY = 7,
SPACE_OP_ERROR_DISPLAY_IS_ANIMATING = 8,
SPACE_OP_ERROR_IN_MISSION_CONTROL = 9,
SPACE_OP_ERROR_SCRIPTING_ADDITION = 10,
};

bool space_manager_has_separate_spaces(void);
Expand Down

0 comments on commit 5cb2530

Please sign in to comment.