From 55525015cc6b1a2e41fdaf85e9f03301dd7bd63b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fernando=20Tarl=C3=A1=20Cardoso=20Lemos?= Date: Sun, 29 Jan 2012 15:53:30 -0200 Subject: [PATCH] Fix coords of floating containers when the output is disabled. This prevents floating containers from "disappearing" when their associated output is disabled. Thanks Michael for the advice. --- src/randr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/randr.c b/src/randr.c index bb6b4e90..e65fdbd6 100644 --- a/src/randr.c +++ b/src/randr.c @@ -754,7 +754,8 @@ void randr_query_outputs() { DLOG("next = %p\n", next); } - /* 2: iterate through workspaces and re-assign them */ + /* 2: iterate through workspaces and re-assign them, fixing the coordinates + * of floating containers as we go */ Con *current; Con *old_content = output_get_content(output->con); while (!TAILQ_EMPTY(&(old_content->nodes_head))) { @@ -763,6 +764,10 @@ void randr_query_outputs() { con_detach(current); DLOG("Re-attaching current = %p / %s\n", current, current->name); con_attach(current, first_content, false); + DLOG("Fixing the coordinates of floating containers\n"); + Con *floating_con; + TAILQ_FOREACH(floating_con, &(current->floating_head), floating_windows) + floating_fix_coordinates(floating_con, &(old_content->rect), &(first_content->rect)); DLOG("Done, next\n"); } DLOG("re-attached all workspaces\n"); -- 2.39.5