Skip to content

Commit

Permalink
#661 report proper error message when trying to use absolute resizing…
Browse files Browse the repository at this point in the history
… on a managed window
  • Loading branch information
koekeishiya committed Nov 14, 2020
1 parent a39eefb commit 0cfc80c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Windows that do not report a title at all should be treated as having the empty string as its title [#707](https://github.com/koekeishiya/yabai/issues/707)
- Allow *SPACE_SEL* to be used instead of *mission-control index* when specifying config options for a specific space [#705](https://github.com/koekeishiya/yabai/issues/705)
- Native fullscreen transitions would freeze on macOS Mojave due to internal API differences between macOS version [#690](https://github.com/koekeishiya/yabai/issues/690)
- Report proper error message when trying to use absolute resizing on a managed window [#661](https://github.com/koekeishiya/yabai/issues/661)

## [3.3.4] - 2020-11-14
### Changed
Expand Down
2 changes: 2 additions & 0 deletions src/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,8 @@ static void handle_domain_window(FILE *rsp, struct token domain, char *message)
daemon_fail(rsp, "cannot locate bsp node for the managed window.\n");
} else if (result == WINDOW_OP_ERROR_INVALID_DST_NODE) {
daemon_fail(rsp, "cannot locate a bsp node fence.\n");
} else if (result == WINDOW_OP_ERROR_INVALID_OPERATION) {
daemon_fail(rsp, "cannot use absolute resizing on a managed window.\n");
}
} else {
daemon_fail(rsp, "unknown value '%.*s' given to command '%.*s' for domain '%.*s'\n", value.length, value.text, command.length, command.text, domain.length, domain.text);
Expand Down
6 changes: 4 additions & 2 deletions src/window_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,14 @@ enum window_op_error window_manager_resize_window_relative(struct window_manager
{
struct view *view = window_manager_find_managed_window(wm, window);
if (view) {
struct window_node *x_fence = NULL;
struct window_node *y_fence = NULL;
if (direction == HANDLE_ABS) return WINDOW_OP_ERROR_INVALID_OPERATION;

struct window_node *node = view_find_window_node(view, window->id);
if (!node) return WINDOW_OP_ERROR_INVALID_SRC_NODE;

struct window_node *x_fence = NULL;
struct window_node *y_fence = NULL;

if (direction & HANDLE_TOP) x_fence = window_node_fence(node, DIR_NORTH);
if (direction & HANDLE_BOTTOM) x_fence = window_node_fence(node, DIR_SOUTH);
if (direction & HANDLE_LEFT) y_fence = window_node_fence(node, DIR_WEST);
Expand Down
1 change: 1 addition & 0 deletions src/window_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ enum window_op_error
WINDOW_OP_ERROR_INVALID_SRC_NODE,
WINDOW_OP_ERROR_INVALID_DST_VIEW,
WINDOW_OP_ERROR_INVALID_DST_NODE,
WINDOW_OP_ERROR_INVALID_OPERATION,
WINDOW_OP_ERROR_SAME_WINDOW,
WINDOW_OP_ERROR_CANT_MINIMIZE,
WINDOW_OP_ERROR_ALREADY_MINIMIZED,
Expand Down

0 comments on commit 0cfc80c

Please sign in to comment.