Revert "Prevent windows from drifting on restart."
authorCarlos R. Mafra <crmafra@gmail.com>
Tue, 18 Dec 2012 18:29:11 +0000 (18 18:29 +0000)
committerCarlos R. Mafra <crmafra@gmail.com>
Tue, 18 Dec 2012 18:29:11 +0000 (18 18:29 +0000)
This reverts commit 3cd382bccc46b957c9a699fe5fa827f32704dfcd.

Conflicts:
src/window.c

src/window.c

index f0df269..4051035 100644 (file)
@@ -1140,7 +1140,11 @@ WWindow *wManageWindow(WScreen *scr, Window window)
                        y -= wwin->frame->top_width + wwin->frame->bottom_width;
        }
 
-       {
+       /* wWindowConfigure() will account for the window border
+        * when placing so the window would be shifted without
+        * the adjustment below
+        */
+       if (HAS_BORDER(wwin)) {
                WMRect rect;
                WArea usableArea;
                int head;
@@ -1153,21 +1157,10 @@ WWindow *wManageWindow(WScreen *scr, Window window)
                head = wGetHeadForRect(scr, rect);
                usableArea = wGetUsableAreaForHead(scr, head, NULL, True);
 
-               /* wWindowConfigure() will account for the frame
-                * when placing so the window would be shifted without
-                * the adjustment below */
-               if (y >= usableArea.y1 + wwin->frame->top_width)
-                       y -= wwin->frame->top_width;
-
-               /* wWindowConfigure() will account for the window border
-                * when placing so the window would be shifted without
-                * the adjustment below */
-               if (HAS_BORDER(wwin)) {
-                       if (x >= usableArea.x1 + FRAME_BORDER_WIDTH)
-                               x -= FRAME_BORDER_WIDTH;
-                       if (y >= usableArea.y1 + FRAME_BORDER_WIDTH)
-                               y -= FRAME_BORDER_WIDTH;
-               }
+               if (x >= usableArea.x1 + 2 * FRAME_BORDER_WIDTH)
+                       x -= 2 * FRAME_BORDER_WIDTH;
+               if (y >= usableArea.y1 + 2 * FRAME_BORDER_WIDTH)
+                       y -= 2 * FRAME_BORDER_WIDTH;
        }
 
        /*