bugfix: reposition windows only if they are invisible changing the layout or the number of the attached monitors might lead to invisible windows. only those windows should be positioned to the closest monitor, if they are not visible already.
Mathias Gumz akira at fluxbox dot org
1 files changed,
19 insertions(+),
4 deletions(-)
jump to
M
src/Screen.cc
→
src/Screen.cc
@@ -1990,11 +1990,26 @@ 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 + FluxboxWindow& w = *(*win); + + // check if the window is invisible + bool invisible = true; + int j; + for (j = 0; j < m_xinerama_num_heads; ++j) { + XineramaHeadInfo& hi = m_xinerama_headinfo[j]; + if (RectangleUtil::overlapRectangles(hi, w)) { + invisible = false; + break; + } + } + + if (invisible) { // get closest head and replace the (now invisible) cwindow + int closest_head = getHead(w.fbWindow()); + if (closest_head == 0) { + closest_head = 1; // first head is a safe bet here + } + w.placeWindow(closest_head); } - (*win)->placeWindow(closest_head); } } }