aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStivvo <stivvo01@gmail.com>2020-10-25 11:56:21 +0100
committerStivvo <stivvo01@gmail.com>2020-10-25 11:56:21 +0100
commit3c3714aac05643ce59692f2c2442db3def993b4d (patch)
tree935b102e21aff71a1be9e84f0965e621cf4da24b
parent4c0d59c1a724420bfd6d602c65d7ac6ab05e6eaf (diff)
Handle monitor enable
-rw-r--r--dwl.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/dwl.c b/dwl.c
index e168f58..56801a0 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 (config_head->state.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);