diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-30 23:27:49 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-30 23:27:49 +1000 |
commit | 7be309710dcd679e0b570bc2f076ac00ae9ad65d (patch) | |
tree | 66f53dddfcd94217beedf25272fe427a34ab665f /sway/tree/output.c | |
parent | Merge pull request #3020 from emersion/swaymsg-return-status (diff) | |
download | sway-7be309710dcd679e0b570bc2f076ac00ae9ad65d.tar.gz sway-7be309710dcd679e0b570bc2f076ac00ae9ad65d.tar.zst sway-7be309710dcd679e0b570bc2f076ac00ae9ad65d.zip |
Remove enum movement_direction
There's no point having both movement_direction and wlr_direction. This
replaces the former with the latter.
As movement_direction also contained MOVE_PARENT and MOVE_CHILD items,
these are now checked specifically in the focus command and handled in
separate functions, just like the other focus variants.
Diffstat (limited to 'sway/tree/output.c')
-rw-r--r-- | sway/tree/output.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sway/tree/output.c b/sway/tree/output.c index 632501e1..b84053d9 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c | |||
@@ -274,16 +274,14 @@ struct sway_output *output_from_wlr_output(struct wlr_output *output) { | |||
274 | } | 274 | } |
275 | 275 | ||
276 | struct sway_output *output_get_in_direction(struct sway_output *reference, | 276 | struct sway_output *output_get_in_direction(struct sway_output *reference, |
277 | enum movement_direction direction) { | 277 | enum wlr_direction direction) { |
278 | enum wlr_direction wlr_dir = 0; | 278 | if (!sway_assert(direction, "got invalid direction: %d", direction)) { |
279 | if (!sway_assert(sway_dir_to_wlr(direction, &wlr_dir), | ||
280 | "got invalid direction: %d", direction)) { | ||
281 | return NULL; | 279 | return NULL; |
282 | } | 280 | } |
283 | int lx = reference->wlr_output->lx + reference->width / 2; | 281 | int lx = reference->wlr_output->lx + reference->width / 2; |
284 | int ly = reference->wlr_output->ly + reference->height / 2; | 282 | int ly = reference->wlr_output->ly + reference->height / 2; |
285 | struct wlr_output *wlr_adjacent = wlr_output_layout_adjacent_output( | 283 | struct wlr_output *wlr_adjacent = wlr_output_layout_adjacent_output( |
286 | root->output_layout, wlr_dir, reference->wlr_output, lx, ly); | 284 | root->output_layout, direction, reference->wlr_output, lx, ly); |
287 | if (!wlr_adjacent) { | 285 | if (!wlr_adjacent) { |
288 | return NULL; | 286 | return NULL; |
289 | } | 287 | } |