diff options
author | Drew DeVault <[email protected]> | 2015-10-21 18:24:07 -0400 |
---|---|---|
committer | Drew DeVault <[email protected]> | 2015-10-21 18:24:07 -0400 |
commit | 3e2579b22cb76e098e78aec62c3c40a4bde0e394 (patch) | |
tree | add4f0b2a97d46fc8ddbd34d61656b3474592083 /sway/commands.c | |
parent | aef31910222702c4cef8de17487f87b910a601f3 (diff) | |
parent | 9b271573a9c5b4f55a1625435aa01de0539f3333 (diff) |
Merge pull request #197 from sce/configure_outputs_during_reload_
Configure outputs during reload
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sway/commands.c b/sway/commands.c index eb77c172..7605a36b 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -561,7 +561,6 @@ static enum cmd_status cmd_orientation(int argc, char **argv) { } static enum cmd_status cmd_output(int argc, char **argv) { - if (!config->reading) return CMD_FAILURE; if (!checkarg(argc, "output", EXPECTED_AT_LEAST, 1)) { return CMD_FAILURE; } @@ -619,9 +618,23 @@ static enum cmd_status cmd_output(int argc, char **argv) { list_add(config->output_configs, output); - sway_log(L_DEBUG, "Configured output %s to %d x %d @ %d, %d", + 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; } |