From b3361eae0229d18c9f23c5715fbceb745b44037e Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sat, 1 May 2010 14:29:31 +0200 Subject: use new closest head calculation code to place windows when clearing up heads --- src/Screen.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 17615fe..0b477d7 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1998,14 +1998,16 @@ void BScreen::clearHeads() { if (!hasXinerama()) return; for (Workspaces::iterator i = m_workspaces_list.begin(); - i != m_workspaces_list.end(); i++) { - for (Workspace::Windows::iterator win = (*i)->windowList().begin(); - win != (*i)->windowList().end(); win++) { - if (getHead((*win)->fbWindow()) == 0) { - // first head is a safe bet here - (*win)->placeWindow(1); + i != m_workspaces_list.end(); i++) { + for (Workspace::Windows::iterator win = (*i)->windowList().begin(); + win != (*i)->windowList().end(); win++) { + + int closest_head = getHead((*win)->fbWindow()); + if (closest_head == 0) { + closest_head = 1; // first head is a safe bet here } - } + (*win)->placeWindow(closest_head); + } } } -- cgit v0.11.2