From 42aea0b17d6e221c8932b3c3ce63329c4b6e560d Mon Sep 17 00:00:00 2001 From: Stivvo Date: Sun, 25 Oct 2020 11:56:21 +0100 Subject: Handle monitor enable --- dwl.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dwl.c b/dwl.c index e168f58..9fcd507 100644 --- a/dwl.c +++ b/dwl.c @@ -1463,10 +1463,17 @@ outputmgrapplyortest(struct wlr_output_configuration_v1 *config, bool test) wl_list_for_each(config_head, &config->heads, link) { struct wlr_output *wlr_output = config_head->state.output; + Monitor *m; wlr_output_enable(wlr_output, config_head->state.enabled); - if (!config_head->state.enabled) { - Monitor *m; + if (!wlr_output->enabled) { + wl_list_for_each(m, &mons, link) { + if (m->wlr_output == wlr_output) { + wlr_output_set_mode(m->wlr_output, wlr_output_preferred_mode(m->wlr_output)); + break; + } + } + } else { wl_list_for_each(m, &mons, link) { if (m->wlr_output == wlr_output) { closemon(m); -- cgit v1.2.3