From cba258e16ac4d37841b89f2b6a38e1056acae97b Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Tue, 3 Apr 2018 12:39:03 -0400 Subject: move output code out of the tree --- sway/desktop/output.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sway/desktop/output.c') diff --git a/sway/desktop/output.c b/sway/desktop/output.c index a1f89cf9..e60fac5f 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -21,6 +22,16 @@ #include "sway/tree/layout.h" #include "sway/tree/view.h" +struct sway_container *output_by_name(const char *name) { + for (int i = 0; i < root_container.children->length; ++i) { + struct sway_container *output = root_container.children->items[i]; + if (strcasecmp(output->name, name) == 0){ + return output; + } + } + return NULL; +} + /** * Rotate a child's position relative to a parent. The parent size is (pw, ph), * the child position is (*sx, *sy) and its size is (sw, sh). -- cgit v1.2.3-54-g00ecf