]> Dogcows Code - chaz/openbox/commitdiff
dont snap windows to rects they arent in for the screen regions (xinerama) or strut...
authorDana Jansens <danakj@orodu.net>
Mon, 22 Jul 2002 07:31:07 +0000 (07:31 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 22 Jul 2002 07:31:07 +0000 (07:31 +0000)
src/Screen.cc
src/Screen.hh
src/Window.cc

index 46b15b2238800c6bb007e42c6f824666eab61552..ef7fb6a50a728af3951653f6d671d8c8815a5083 100644 (file)
@@ -2075,9 +2075,12 @@ const Rect& BScreen::availableArea(void) const {
 
 
 #ifdef    XINERAMA
-RectList BScreen::allAvailableAreas(void) const {
+const RectList& BScreen::allAvailableAreas(void) const {
   assert(isXineramaActive());
   assert(xineramaUsableArea.size() > 0);
+  fprintf(stderr, "1found x %d y %d w %d h %d\n",
+          xineramaUsableArea[0].x(), xineramaUsableArea[0].y(),
+          xineramaUsableArea[0].width(), xineramaUsableArea[0].height());
   return xineramaUsableArea;
 }
 #endif // XINERAMA
index 87d11c68cbfe9f8daaa6770ed21d7adc7f0e1835..a36205539b110991f00695d77b56c8a75fab7e40 100644 (file)
@@ -313,7 +313,7 @@ public:
   // as then Xinerama will work correctly.
   const Rect& availableArea(void) const;
 #ifdef    XINERAMA
-  RectList allAvailableAreas(void) const;
+  const RectList& allAvailableAreas(void) const;
 #endif // XINERAMA
   void updateAvailableArea(void);
   void addStrut(Strut *strut);
index a5fe7b4b2ff2e255836215b33caeaa4e7491466d..9de8b05291b9ba351fb8e8bec9c3bda3dd7bef60 100644 (file)
@@ -3039,11 +3039,11 @@ void BlackboxWindow::doMove(int x_root, int y_root) {
 
     // snap to the strut (and screen boundaries for xinerama)
 #ifdef    XINERAMA
-    if (screen->isXineramaActive() && blackbox->doXineramaSnapping()) {
-      RectList::iterator it, end = screen->allAvailableAreas().end();
-      for (it = screen->allAvailableAreas().begin(); it != end; ++it)
-        snaplist.push_back(*it);
-    else
+    if (screen->isXineramaActive() && blackbox->doXineramaSnapping())
+      snaplist.insert(snaplist.begin(),
+                      screen->allAvailableAreas().begin(),
+                      screen->allAvailableAreas().end());
+    else
 #endif // XINERAMA
       if (! screen->doFullMax())
         snaplist.push_back(screen->availableArea());
@@ -3051,9 +3051,14 @@ void BlackboxWindow::doMove(int x_root, int y_root) {
     // always snap to the screen edges
     snaplist.push_back(screen->getRect());
 
-    RectList::iterator it, end = snaplist.end();
+    RectList::const_iterator it, end = snaplist.end();
     for (it = snaplist.begin(); it != end; ++it) {
-      Rect &srect = *it;
+      const Rect &srect = *it;
+
+      // if we're not in the rectangle then don't snap to it.
+      if (! srect.intersects(Rect(wleft, wtop, frame.rect.width(),
+                                  frame.rect.height())))
+        continue;
 
       int dleft = std::abs(wleft - srect.left()),
          dright = std::abs(wright - srect.right()),
This page took 0.032617 seconds and 4 git commands to generate.