aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorPeter Hercek <hercek@users.sourceforge.net>2012-07-28 22:00:59 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2012-08-22 16:49:09 (GMT)
commit60a53113e05db443af4d520883ec3145680642a8 (patch)
tree42e83d8d35cb0b66722969d4e3bab1b56b67c662 /src/Window.cc
parent71f75c70ae4e47ba0a58590aeb17152fc648edf7 (diff)
downloadfluxbox_pavel-60a53113e05db443af4d520883ec3145680642a8.zip
fluxbox_pavel-60a53113e05db443af4d520883ec3145680642a8.tar.bz2
fix sanity check for transient and explicitly placed windows
When a screen has more heads and some part of the screen is not on any head and some window is placed into this invisible area then the window is invisible which sucks. This patch repositions such windows so that they are visible. Example: * head 1 is at (0,120) (size 640x480) * head 2 is at (480,0) (size 800x600) * whole screen virtual size is 1440x600 * that means rectangle from (0,0) to (640,120) is not visible on any head and any windows placed there would not be visible; for example wireshark likes to place dialog boxes at (0,0)
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 747c909..597bc08 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -446,11 +446,15 @@ void FluxboxWindow::init() {
446 int real_x = frame().x(); 446 int real_x = frame().x();
447 int real_y = frame().y(); 447 int real_y = frame().y();
448 448
449 if (real_x >= 0 && 449 if (screen().hasXinerama()) { // xinerama available => use head info
450 real_y >= 0 && 450 if (0 != screen().getHead(real_x, real_y)) // if visible on some head
451 real_x <= (signed) screen().width() && 451 m_placed = true;
452 real_y <= (signed) screen().height()) 452 } else { // no xinerama available => use screen info
453 m_placed = true; 453 if (real_x >= 0 && real_y >= 0 &&
454 real_x <= (signed) screen().width() &&
455 real_y <= (signed) screen().height()) // if visible on the screen
456 m_placed = true;
457 }
454 458
455 } else 459 } else
456 setOnHead(screen().getCurrHead()); 460 setOnHead(screen().getCurrHead());