aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/output.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-10-26 14:00:37 +0200
committerDrew DeVault <sir@cmpwn.com>2019-10-27 10:51:02 -0400
commitec14a00e8c6751d0b73ca0ad5f756e4165092b87 (patch)
tree36a4a947b4fb9d89fec848a2e269304ded139621 /sway/tree/output.c
parent58a40ce07b2e20e6fca70fba4c2775510928d33e (diff)
Fix segfault in wlr_output_manager_v1_set_configuration
Calling wlr_output_manager_v1_set_configuration with an enabled output and a NULL mode is incorrect if the output doesn't support modes. When DPMS'ing an output, wlr_output_enable(output, false) is called. This de-allocates the CRTC and sets wlr_output.current_mode to NULL. Because we mark DPMS'ed outputs as enabled, we also need to provide a correct output mode. Add a field to sway_output to hold the current mode. Closes: https://github.com/swaywm/wlroots/issues/1867
Diffstat (limited to 'sway/tree/output.c')
-rw-r--r--sway/tree/output.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sway/tree/output.c b/sway/tree/output.c
index 33fdee5e..07f04ee5 100644
--- a/sway/tree/output.c
+++ b/sway/tree/output.c
@@ -269,6 +269,7 @@ void output_disable(struct sway_output *output) {
output->enabled = false;
output->configured = false;
+ output->current_mode = NULL;
arrange_root();
}