aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/output.c
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2019-10-26 13:59:19 +0200
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-10-27 10:51:02 -0400
commit58a40ce07b2e20e6fca70fba4c2775510928d33e (patch)
tree5bb86b3f7bd50e1c1d0ef3984b16e8c66c6a9fe4 /sway/tree/output.c
parentFix tiled containers resize with mouse (diff)
downloadsway-58a40ce07b2e20e6fca70fba4c2775510928d33e.tar.gz
sway-58a40ce07b2e20e6fca70fba4c2775510928d33e.tar.zst
sway-58a40ce07b2e20e6fca70fba4c2775510928d33e.zip
Fix apply_output_config return value when enabling output
apply_output_config would call output_enable and always return true, even if the output couldn't be enabled.
Diffstat (limited to 'sway/tree/output.c')
-rw-r--r--sway/tree/output.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sway/tree/output.c b/sway/tree/output.c
index 24adc08d..33fdee5e 100644
--- a/sway/tree/output.c
+++ b/sway/tree/output.c
@@ -60,7 +60,7 @@ static void restore_workspaces(struct sway_output *output) {
60 struct sway_workspace *ws = root->noop_output->workspaces->items[0]; 60 struct sway_workspace *ws = root->noop_output->workspaces->items[0];
61 workspace_detach(ws); 61 workspace_detach(ws);
62 output_add_workspace(output, ws); 62 output_add_workspace(output, ws);
63 63
64 // If the floater was made floating while on the NOOP output, its width 64 // If the floater was made floating while on the NOOP output, its width
65 // and height will be zero and it should be reinitialized as a floating 65 // and height will be zero and it should be reinitialized as a floating
66 // container to get the appropriate size and location. Additionally, if 66 // container to get the appropriate size and location. Additionally, if
@@ -104,9 +104,9 @@ struct sway_output *output_create(struct wlr_output *wlr_output) {
104 return output; 104 return output;
105} 105}
106 106
107void output_enable(struct sway_output *output, struct output_config *oc) { 107bool output_enable(struct sway_output *output, struct output_config *oc) {
108 if (!sway_assert(!output->enabled, "output is already enabled")) { 108 if (!sway_assert(!output->enabled, "output is already enabled")) {
109 return; 109 return false;
110 } 110 }
111 struct wlr_output *wlr_output = output->wlr_output; 111 struct wlr_output *wlr_output = output->wlr_output;
112 size_t len = sizeof(output->layers) / sizeof(output->layers[0]); 112 size_t len = sizeof(output->layers) / sizeof(output->layers[0]);
@@ -117,7 +117,7 @@ void output_enable(struct sway_output *output, struct output_config *oc) {
117 output->enabled = true; 117 output->enabled = true;
118 if (!apply_output_config(oc, output)) { 118 if (!apply_output_config(oc, output)) {
119 output->enabled = false; 119 output->enabled = false;
120 return; 120 return false;
121 } 121 }
122 122
123 output->configured = true; 123 output->configured = true;
@@ -155,6 +155,8 @@ void output_enable(struct sway_output *output, struct output_config *oc) {
155 155
156 arrange_layers(output); 156 arrange_layers(output);
157 arrange_root(); 157 arrange_root();
158
159 return true;
158} 160}
159 161
160static void evacuate_sticky(struct sway_workspace *old_ws, 162static void evacuate_sticky(struct sway_workspace *old_ws,