Bugfix: Render workspaces created by assignments to use correct coordinates (Thanks meaneye)

Previously, i3 would send width=0, height=0 to windows which were put on
workspaces created by an assignment (that is, invisible workspaces,
which do not get rendered normally).

fixes #653
This commit is contained in:
Michael Stapelberg 2012-09-24 23:57:58 +02:00
parent 393a1c0851
commit 372d47842e
1 changed files with 16 additions and 0 deletions

View File

@ -381,6 +381,22 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
/* Check if any assignments match */ /* Check if any assignments match */
run_assignments(cwindow); run_assignments(cwindow);
/* If this window was put onto an invisible workspace (via assignments), we
* render this workspace. It wouldnt be rendered in our normal code path
* because only the visible workspaces get rendered.
*
* By rendering the workspace, we assign proper coordinates (read: not
* width=0, height=0) to the window, which is important for windows who
* actually use them to position their GUI elements, e.g. rhythmbox. */
if (ws && !workspace_is_visible(ws)) {
/* This is a bit hackish: we need to copy the content containers rect
* to the workspace, because calling render_con() on the content
* container would also take the shortcut and not render the invisible
* workspace at all. However, just calling render_con() on the
* workspace isnt enough either it needs the rect. */
ws->rect = ws->parent->rect;
render_con(ws, true);
}
tree_render(); tree_render();
geom_out: geom_out: