diff options
-rw-r--r-- | sway/container.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sway/container.c b/sway/container.c index 444f85fd..6e6b20b2 100644 --- a/sway/container.c +++ b/sway/container.c | |||
@@ -90,22 +90,28 @@ swayc_t *new_output(wlc_handle handle) { | |||
90 | 90 | ||
91 | sway_log(L_DEBUG, "New output %lu:%s", handle, name); | 91 | sway_log(L_DEBUG, "New output %lu:%s", handle, name); |
92 | 92 | ||
93 | struct output_config *oc = NULL; | 93 | struct output_config *oc = NULL, *all = NULL; |
94 | int i; | 94 | int i; |
95 | for (i = 0; i < config->output_configs->length; ++i) { | 95 | for (i = 0; i < config->output_configs->length; ++i) { |
96 | struct output_config *cur = config->output_configs->items[i]; | 96 | struct output_config *cur = config->output_configs->items[i]; |
97 | if (strcasecmp(name, cur->name) == 0) { | 97 | if (strcasecmp(name, cur->name) == 0) { |
98 | sway_log(L_DEBUG, "Matched output config for %s", name); | 98 | sway_log(L_DEBUG, "Matched output config for %s", name); |
99 | oc = cur; | 99 | oc = cur; |
100 | break; | ||
101 | } | 100 | } |
102 | if (strcasecmp("*", cur->name) == 0) { | 101 | if (strcasecmp("*", cur->name) == 0) { |
103 | sway_log(L_DEBUG, "Matched wildcard output config for %s", name); | 102 | sway_log(L_DEBUG, "Matched wildcard output config for %s", name); |
104 | oc = cur; | 103 | all = cur; |
104 | } | ||
105 | |||
106 | if (oc && all) { | ||
105 | break; | 107 | break; |
106 | } | 108 | } |
107 | } | 109 | } |
108 | 110 | ||
111 | if (!oc) { | ||
112 | oc = all; | ||
113 | } | ||
114 | |||
109 | if (oc && !oc->enabled) { | 115 | if (oc && !oc->enabled) { |
110 | return NULL; | 116 | return NULL; |
111 | } | 117 | } |