aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-10-26 13:59:19 +0200
committerDrew DeVault <sir@cmpwn.com>2019-10-27 10:51:02 -0400
commit58a40ce07b2e20e6fca70fba4c2775510928d33e (patch)
tree5bb86b3f7bd50e1c1d0ef3984b16e8c66c6a9fe4 /sway
parent43bd8dc437866ce1e6ba8e276af511a9ddebe71d (diff)
downloadsway-58a40ce07b2e20e6fca70fba4c2775510928d33e.tar.xz
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')
-rw-r--r--sway/config/output.c3
-rw-r--r--sway/tree/output.c10
2 files changed, 7 insertions, 6 deletions
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) {
if (!oc || oc->dpms_state != DPMS_OFF) {
wlr_output_enable(wlr_output, true);
}
- output_enable(output, oc);
- return true;
+ return output_enable(output, oc);
}
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) {
struct sway_workspace *ws = root->noop_output->workspaces->items[0];
workspace_detach(ws);
output_add_workspace(output, ws);
-
+
// If the floater was made floating while on the NOOP output, its width
// and height will be zero and it should be reinitialized as a floating
// container to get the appropriate size and location. Additionally, if
@@ -104,9 +104,9 @@ struct sway_output *output_create(struct wlr_output *wlr_output) {
return output;
}
-void output_enable(struct sway_output *output, struct output_config *oc) {
+bool output_enable(struct sway_output *output, struct output_config *oc) {
if (!sway_assert(!output->enabled, "output is already enabled")) {
- return;
+ return false;
}
struct wlr_output *wlr_output = output->wlr_output;
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) {
output->enabled = true;
if (!apply_output_config(oc, output)) {
output->enabled = false;
- return;
+ return false;
}
output->configured = true;
@@ -155,6 +155,8 @@ void output_enable(struct sway_output *output, struct output_config *oc) {
arrange_layers(output);
arrange_root();
+
+ return true;
}
static void evacuate_sticky(struct sway_workspace *old_ws,