aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sway/output.h2
-rw-r--r--sway/config/output.c3
-rw-r--r--sway/tree/output.c10
3 files changed, 8 insertions, 7 deletions
diff --git a/include/sway/output.h b/include/sway/output.h
index b94824b4..c52b3094 100644
--- a/include/sway/output.h
+++ b/include/sway/output.h
@@ -90,7 +90,7 @@ struct sway_output *all_output_by_name_or_id(const char *name_or_id);
90 90
91void output_sort_workspaces(struct sway_output *output); 91void output_sort_workspaces(struct sway_output *output);
92 92
93void output_enable(struct sway_output *output, struct output_config *oc); 93bool output_enable(struct sway_output *output, struct output_config *oc);
94 94
95void output_disable(struct sway_output *output); 95void output_disable(struct sway_output *output);
96 96
diff --git a/sway/config/output.c b/sway/config/output.c
index 12a875b7..3c36692f 100644
--- a/sway/config/output.c
+++ b/sway/config/output.c
@@ -249,8 +249,7 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) {
249 if (!oc || oc->dpms_state != DPMS_OFF) { 249 if (!oc || oc->dpms_state != DPMS_OFF) {
250 wlr_output_enable(wlr_output, true); 250 wlr_output_enable(wlr_output, true);
251 } 251 }
252 output_enable(output, oc); 252 return output_enable(output, oc);
253 return true;
254 } 253 }
255 254
256 if (oc && oc->dpms_state == DPMS_ON) { 255 if (oc && oc->dpms_state == DPMS_ON) {
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,