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:
parent
927352865c
commit
4c0d59c1a7
12
dwl.c
12
dwl.c
@ -1465,6 +1465,15 @@ outputmgrapplyortest(struct wlr_output_configuration_v1 *config, bool test)
|
|||||||
struct wlr_output *wlr_output = config_head->state.output;
|
struct wlr_output *wlr_output = config_head->state.output;
|
||||||
|
|
||||||
wlr_output_enable(wlr_output, config_head->state.enabled);
|
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.enabled) {
|
||||||
if (config_head->state.mode)
|
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);
|
wlr_output_configuration_v1_send_succeeded(config);
|
||||||
if (!test)
|
if (!test)
|
||||||
updatemons();
|
updatemons();
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
wlr_output_configuration_v1_send_failed(config);
|
wlr_output_configuration_v1_send_failed(config);
|
||||||
wlr_output_configuration_v1_destroy(config);
|
wlr_output_configuration_v1_destroy(config);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user