summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStivvo <stivvo01@gmail.com>2020-10-25 11:16:37 +0100
committerStivvo <stivvo01@gmail.com>2020-10-25 11:22:58 +0100
commit4c0d59c1a724420bfd6d602c65d7ac6ab05e6eaf (patch)
treee2d11210f441998347942a60a1de0c127540794a
parent927352865c74dcefb7192b83a2cc81c5bbc54beb (diff)
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
-rw-r--r--dwl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/dwl.c b/dwl.c
index dda407a..e168f58 100644
--- a/dwl.c
+++ b/dwl.c
@@ -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);
}