From 9de41b30be9af1266860f6e3c76c4e85bfb9abc8 Mon Sep 17 00:00:00 2001
From: markt <markt>
Date: Sat, 20 Jan 2007 18:24:55 +0000
Subject: minor changes for cascade placement

---
 ChangeLog               |  3 +++
 src/CascadePlacement.cc | 13 ++++++-------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6b2735a..d95da39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
  (Format: Year/Month/Day)
 Changes for 1.0rc3:
+*07/01/20:
+   * Don't place windows over toolbar at the top of the screen (Mark)
+     CascadePlacement.cc
 *07/01/16:
    * Make right-clicking on iconbar button behave the same way as tabs (Mark)
      IconButton.cc
diff --git a/src/CascadePlacement.cc b/src/CascadePlacement.cc
index 4cad9d0..e2993d2 100644
--- a/src/CascadePlacement.cc
+++ b/src/CascadePlacement.cc
@@ -31,8 +31,8 @@ CascadePlacement::CascadePlacement(const BScreen &screen) {
     m_cascade_x = new int[screen.numHeads() + 1];
     m_cascade_y = new int[screen.numHeads() + 1];
     for (int i=0; i < screen.numHeads() + 1; i++) {
-        m_cascade_x[i] = 32 + screen.getHeadX(i);
-        m_cascade_y[i] = 32 + screen.getHeadY(i);
+        m_cascade_x[i] = 32 + screen.maxLeft(i);
+        m_cascade_y[i] = 32 + screen.maxTop(i);
     }
 
 }
@@ -52,11 +52,10 @@ bool CascadePlacement::placeWindow(const std::vector<FluxboxWindow *> &windowlis
     int head_top = (signed) win.screen().maxTop(head);
     int head_bot = (signed) win.screen().maxBottom(head);
 
-    if ((m_cascade_x[head] > ((head_left + head_right) / 2)) ||
-        (m_cascade_y[head] > ((head_top + head_bot) / 2))) {
-        m_cascade_x[head] = head_left + 32;
-        m_cascade_y[head] = head_top + 32;
-    }
+    if (m_cascade_x[head] > ((head_left + head_right) / 2))
+        m_cascade_x[head] = head_left;
+    if (m_cascade_y[head] > ((head_top + head_bot) / 2))
+        m_cascade_y[head] = head_top;
 
     place_x = m_cascade_x[head];
     place_y = m_cascade_y[head];
-- 
cgit v0.11.2