aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/output.c')
-rw-r--r--sway/tree/output.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sway/tree/output.c b/sway/tree/output.c
index 7248fd00..0509db23 100644
--- a/sway/tree/output.c
+++ b/sway/tree/output.c
@@ -1,3 +1,4 @@
+#include <strings.h>
#include "sway/tree/container.h"
#include "sway/tree/layout.h"
#include "sway/output.h"
@@ -29,6 +30,7 @@ struct sway_container *container_output_destroy(struct sway_container *output) {
wl_list_remove(&output->sway_output->destroy.link);
wl_list_remove(&output->sway_output->mode.link);
wl_list_remove(&output->sway_output->transform.link);
+ wl_list_remove(&output->sway_output->scale.link);
wl_list_remove(&output->sway_output->damage_destroy.link);
wl_list_remove(&output->sway_output->damage_frame.link);
@@ -37,3 +39,13 @@ struct sway_container *container_output_destroy(struct sway_container *output) {
container_destroy(output);
return &root_container;
}
+
+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;
+}