summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Daniel Kessler <sinani201@gmail.com>2017-01-13 16:06:10 -0800
committerLibravatar Daniel Kessler <sinani201@gmail.com>2017-01-13 16:06:10 -0800
commiteda4bad725b8a76accdb2a9c648efa046b88c0c0 (patch)
tree68f4595908ff4f33f27e3c30813835642845d290 /include
parentMerge pull request #1044 from ametisf/master (diff)
downloadsway-eda4bad725b8a76accdb2a9c648efa046b88c0c0.tar.gz
sway-eda4bad725b8a76accdb2a9c648efa046b88c0c0.tar.zst
sway-eda4bad725b8a76accdb2a9c648efa046b88c0c0.zip
Add output wrapping
This fixes issue #733. Now if the user focuses output right but is at the rightmost monitor, the focus will wrap the the leftmost monitor. This commit adds a new function, swayc_opposite_output, which selects the opposite output given a position and a direction. Now, when calling output_by_name, we first check if there is an adjacent output to switch to. If that fails, we call swayc_opposite_output to handle wrapping.
Diffstat (limited to 'include')
-rw-r--r--include/sway/output.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sway/output.h b/include/sway/output.h
index e8afd5ed..e1bdd3f0 100644
--- a/include/sway/output.h
+++ b/include/sway/output.h
@@ -7,6 +7,7 @@
7// Position is absolute coordinates on the edge where the adjacent output 7// Position is absolute coordinates on the edge where the adjacent output
8// should be searched for. 8// should be searched for.
9swayc_t *output_by_name(const char* name, const struct wlc_point *abs_pos); 9swayc_t *output_by_name(const char* name, const struct wlc_point *abs_pos);
10swayc_t *swayc_opposite_output(enum movement_direction dir, const struct wlc_point *abs_pos);
10swayc_t *swayc_adjacent_output(swayc_t *output, enum movement_direction dir, const struct wlc_point *abs_pos, bool pick_closest); 11swayc_t *swayc_adjacent_output(swayc_t *output, enum movement_direction dir, const struct wlc_point *abs_pos, bool pick_closest);
11 12
12// Place absolute coordinates for given container into given wlc_point. 13// Place absolute coordinates for given container into given wlc_point.