Skip to content

Commit

Permalink
#181 return a non-zero exit code when 'space --focus ..' fails becaus…
Browse files Browse the repository at this point in the history
…e of the scripting addition
  • Loading branch information
Åsmund Vikane authored and Åsmund Vikane committed Nov 12, 2020
1 parent 41726c4 commit 382a30f
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 @@ -1389,6 +1389,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 @@ -639,6 +639,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 382a30f

Please sign in to comment.