aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2019-10-26 14:00:37 +0200
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-10-27 10:51:02 -0400
commitec14a00e8c6751d0b73ca0ad5f756e4165092b87 (patch)
tree36a4a947b4fb9d89fec848a2e269304ded139621 /sway/desktop/output.c
parentFix apply_output_config return value when enabling output (diff)
downloadsway-ec14a00e8c6751d0b73ca0ad5f756e4165092b87.tar.gz
sway-ec14a00e8c6751d0b73ca0ad5f756e4165092b87.tar.zst
sway-ec14a00e8c6751d0b73ca0ad5f756e4165092b87.zip
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/desktop/output.c')
-rw-r--r--sway/desktop/output.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 42194d54..beb6ee79 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -662,6 +662,7 @@ static void update_output_manager_config(struct sway_server *server) {
662 root->output_layout, output->wlr_output); 662 root->output_layout, output->wlr_output);
663 // We mark the output enabled even if it is switched off by DPMS 663 // We mark the output enabled even if it is switched off by DPMS
664 config_head->state.enabled = output->enabled; 664 config_head->state.enabled = output->enabled;
665 config_head->state.mode = output->current_mode;
665 if (output_box) { 666 if (output_box) {
666 config_head->state.x = output_box->x; 667 config_head->state.x = output_box->x;
667 config_head->state.y = output_box->y; 668 config_head->state.y = output_box->y;