Move clients away from a disabled monitor

When a monitor is disabled with wlr_randr, all clients on that monitor
aren't lost but they are moved to the leftmost monitor with the same
method that handles monitor hot unplug
This commit is contained in:
Stivvo 2020-10-25 11:16:37 +01:00
parent 927352865c
commit 4c0d59c1a7

12
dwl.c
View File

@ -1465,6 +1465,15 @@ outputmgrapplyortest(struct wlr_output_configuration_v1 *config, bool test)
struct wlr_output *wlr_output = config_head->state.output;
wlr_output_enable(wlr_output, config_head->state.enabled);
if (!config_head->state.enabled) {
Monitor *m;
wl_list_for_each(m, &mons, link) {
if (m->wlr_output == wlr_output) {
closemon(m);
break;
}
}
}
if (config_head->state.enabled) {
if (config_head->state.mode)
@ -1491,8 +1500,7 @@ outputmgrapplyortest(struct wlr_output_configuration_v1 *config, bool test)
wlr_output_configuration_v1_send_succeeded(config);
if (!test)
updatemons();
}
else
} else
wlr_output_configuration_v1_send_failed(config);
wlr_output_configuration_v1_destroy(config);
}