diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2011-03-19 14:05:39 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2011-03-19 14:05:39 (GMT) |
commit | 97e08c3853a77571f4d51b481581877db2250555 (patch) | |
tree | 2c446c28a97502582119dc3cde66f6f30d6e23d5 /src | |
parent | c200045e9a5d81a67d98eacffeb6385acdac37e2 (diff) | |
download | fluxbox_paul-97e08c3853a77571f4d51b481581877db2250555.zip fluxbox_paul-97e08c3853a77571f4d51b481581877db2250555.tar.bz2 |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/Screen.cc | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index e54b328..45ca998 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -1990,11 +1990,26 @@ void BScreen::clearHeads() { | |||
1990 | for (Workspace::Windows::iterator win = (*i)->windowList().begin(); | 1990 | for (Workspace::Windows::iterator win = (*i)->windowList().begin(); |
1991 | win != (*i)->windowList().end(); win++) { | 1991 | win != (*i)->windowList().end(); win++) { |
1992 | 1992 | ||
1993 | int closest_head = getHead((*win)->fbWindow()); | 1993 | FluxboxWindow& w = *(*win); |
1994 | if (closest_head == 0) { | 1994 | |
1995 | closest_head = 1; // first head is a safe bet here | 1995 | // check if the window is invisible |
1996 | bool invisible = true; | ||
1997 | int j; | ||
1998 | for (j = 0; j < m_xinerama_num_heads; ++j) { | ||
1999 | XineramaHeadInfo& hi = m_xinerama_headinfo[j]; | ||
2000 | if (RectangleUtil::overlapRectangles(hi, w)) { | ||
2001 | invisible = false; | ||
2002 | break; | ||
2003 | } | ||
2004 | } | ||
2005 | |||
2006 | if (invisible) { // get closest head and replace the (now invisible) cwindow | ||
2007 | int closest_head = getHead(w.fbWindow()); | ||
2008 | if (closest_head == 0) { | ||
2009 | closest_head = 1; // first head is a safe bet here | ||
2010 | } | ||
2011 | w.placeWindow(closest_head); | ||
1996 | } | 2012 | } |
1997 | (*win)->placeWindow(closest_head); | ||
1998 | } | 2013 | } |
1999 | } | 2014 | } |
2000 | } | 2015 | } |