From 349d1f3be87ad9fd49482f64c71eb2665750261b Mon Sep 17 00:00:00 2001 From: emersion Date: Sat, 1 Sep 2018 18:56:53 +0200 Subject: [PATCH] Do not modeset disabled outputs --- sway/config/output.c | 4 ++++ sway/desktop/output.c | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sway/config/output.c b/sway/config/output.c index 16ec9339d..65f09258e 100644 --- a/sway/config/output.c +++ b/sway/config/output.c @@ -196,6 +196,10 @@ void apply_output_config(struct output_config *oc, struct sway_container *output wlr_log(WLR_DEBUG, "Set %s mode to %dx%d (%f GHz)", oc->name, oc->width, oc->height, oc->refresh_rate); set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate); + } else if (!wl_list_empty(&wlr_output->modes)) { + struct wlr_output_mode *mode = + wl_container_of(wlr_output->modes.prev, mode, link); + wlr_output_set_mode(wlr_output, mode); } if (oc && oc->scale > 0) { wlr_log(WLR_DEBUG, "Set %s scale to %f", oc->name, oc->scale); diff --git a/sway/desktop/output.c b/sway/desktop/output.c index c228979d6..c30e52a1c 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -559,12 +559,6 @@ void handle_new_output(struct wl_listener *listener, void *data) { wl_list_insert(&root_container.sway_root->all_outputs, &output->link); - if (!wl_list_empty(&wlr_output->modes)) { - struct wlr_output_mode *mode = - wl_container_of(wlr_output->modes.prev, mode, link); - wlr_output_set_mode(wlr_output, mode); - } - output_enable(output); }