summaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authorS. Christoffer Eliesen <[email protected]>2015-10-21 16:34:12 +0200
committerS. Christoffer Eliesen <[email protected]>2015-10-21 23:24:06 +0200
commitca862a5bd45ef094d0f0de5a0765224524b74c48 (patch)
treeea2b673e5929de337b7444614b0d976bc07c3460 /sway/commands.c
parent6eb8da0e147aa535ec0736684237890ad4291d84 (diff)
config: Apply output config also during config reload.
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 7b026fd2..9eb0928e 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -622,6 +622,20 @@ static enum cmd_status cmd_output(int argc, char **argv) {
sway_log(L_DEBUG, "Config stored for output %s (%d x %d @ %d, %d)",
output->name, output->width, output->height, output->x, output->y);
+ if (output->name) {
+ // Try to find the output container and apply configuration now. If
+ // this is during startup then there will be no container and config
+ // will be applied during normal "new output" event from wlc.
+ swayc_t *cont = NULL;
+ for (int i = 0; i < root_container.children->length; ++i) {
+ cont = root_container.children->items[i];
+ if (cont->name && strcmp(cont->name, output->name) == 0) {
+ apply_output_config(output, cont);
+ break;
+ }
+ }
+ }
+
return CMD_SUCCESS;
}