aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/output.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-04-03 21:53:43 -0400
committerLibravatar Simon Ser <contact@emersion.fr>2019-04-04 20:08:21 +0300
commit75e7bd24ccb9731065bb7f8313aa53ba11ddc420 (patch)
tree2522f31626a21b42c2496a32266eafd3b7d66f50 /sway/commands/output.c
parentidle_inhibit: fix crash during view destruction (diff)
downloadsway-75e7bd24ccb9731065bb7f8313aa53ba11ddc420.tar.gz
sway-75e7bd24ccb9731065bb7f8313aa53ba11ddc420.tar.zst
sway-75e7bd24ccb9731065bb7f8313aa53ba11ddc420.zip
swaybg: one instance for all outputs
This makes it so there will only be one swaybg instance running instead of one per output. swaybg's cli has been changed to a xrandr like interface, where you select an output and then change properties for that output and then select another output and repeat. This also makes it so swaybg is only killed and respawned when a background changes or when reloading.
Diffstat (limited to 'sway/commands/output.c')
-rw-r--r--sway/commands/output.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/commands/output.c b/sway/commands/output.c
index 44e28512..6b9eafdb 100644
--- a/sway/commands/output.c
+++ b/sway/commands/output.c
@@ -68,6 +68,8 @@ struct cmd_results *cmd_output(int argc, char **argv) {
68 config->handler_context.leftovers.argc = 0; 68 config->handler_context.leftovers.argc = 0;
69 config->handler_context.leftovers.argv = NULL; 69 config->handler_context.leftovers.argv = NULL;
70 70
71 bool background = output->background;
72
71 output = store_output_config(output); 73 output = store_output_config(output);
72 74
73 // If reloading, the output configs will be applied after reading the 75 // If reloading, the output configs will be applied after reading the
@@ -75,6 +77,9 @@ struct cmd_results *cmd_output(int argc, char **argv) {
75 // workspace name is not given to re-enabled outputs. 77 // workspace name is not given to re-enabled outputs.
76 if (!config->reloading) { 78 if (!config->reloading) {
77 apply_output_config_to_outputs(output); 79 apply_output_config_to_outputs(output);
80 if (background) {
81 spawn_swaybg();
82 }
78 } 83 }
79 84
80 return cmd_results_new(CMD_SUCCESS, NULL); 85 return cmd_results_new(CMD_SUCCESS, NULL);