aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/output.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-08-25 09:38:33 -0400
committerGitHub <noreply@github.com>2018-08-25 09:38:33 -0400
commitb945957b9bf4508816438186d4ee59dd468160c8 (patch)
treef789e2f6156abbc7662625dffc8cb77b0a4c82d9 /sway/tree/output.c
parent33d102265098f76517be7a6032d4f828c6bd32f4 (diff)
parentf4bc25bcc6c822e264938447940b7d75fa84319b (diff)
downloadsway-b945957b9bf4508816438186d4ee59dd468160c8.tar.xz
Merge pull request #2510 from RyanDwyer/relocate-layout-functions
Relocate container_move, container_move_to and container_get_in_direction
Diffstat (limited to 'sway/tree/output.c')
-rw-r--r--sway/tree/output.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/tree/output.c b/sway/tree/output.c
index 80636c11..bfc9c723 100644
--- a/sway/tree/output.c
+++ b/sway/tree/output.c
@@ -209,6 +209,19 @@ void output_begin_destroy(struct sway_container *output) {
}
}
+struct sway_container *output_from_wlr_output(struct wlr_output *output) {
+ if (output == NULL) {
+ return NULL;
+ }
+ for (int i = 0; i < root_container.children->length; ++i) {
+ struct sway_container *o = root_container.children->items[i];
+ if (o->type == C_OUTPUT && o->sway_output->wlr_output == output) {
+ return o;
+ }
+ }
+ return NULL;
+}
+
void output_for_each_workspace(struct sway_container *output,
void (*f)(struct sway_container *con, void *data), void *data) {
if (!sway_assert(output->type == C_OUTPUT, "Expected an output")) {