]> Dogcows Code - chaz/openbox/blobdiff - src/Workspace.cc
add comment
[chaz/openbox] / src / Workspace.cc
index ac8b9edbfeed442eb9de64e5de77fab688a3e656..366e8192e616e3f96dbfa093a8f489fb6e54e5a6 100644 (file)
@@ -681,7 +681,7 @@ bool Workspace::smartPlacement(Rect& win) {
 }
 
 
-bool Workspace::underMousePlacement(Rect &win) const {
+bool Workspace::underMousePlacement(Rect &win) {
   int x, y, rx, ry;
   Window c, r;
   unsigned int m;
@@ -781,8 +781,10 @@ void Workspace::placeWindow(BlackboxWindow *win) {
     cascadePlacement(new_win, (win->getTitleHeight() +
                                screen->getBorderWidth() * 2));
 
-  // make sure the placement was valid
-  assert(screen->availableArea().contains(new_win));
+  if (new_win.right() > screen->availableArea().right())
+    new_win.setX(screen->availableArea().left());
+  if (new_win.bottom() > screen->availableArea().bottom())
+    new_win.setY(screen->availableArea().top());
 
   win->configure(new_win.x(), new_win.y(), new_win.width(), new_win.height());
 }
This page took 0.021061 seconds and 4 git commands to generate.