1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

Prevent windows from drifting on restart.

Bug report from Paul Seelig:

"Yet another rather strange glitch:

- open three terminal windows
- repeatedly restart wmaker
- all windows slowly drift to the left and up by just a few pixels

If i remember correctly, this is also a longstanding issue and nothing
new. It is no showstopper either, as one rarely restarts wmaker."

The slight drifting left and up seems to have been due to
wWindowConfigure() accounting for the window border when placing, which
was fixed in an earlier commit.

Windows could still shuffle down, however, because wWindowConfigure()
was moving the window down to make room for its window frame.
We now move it up by the titlebar height to cancel out that movement.
This commit is contained in:
Iain Patterson
2012-11-15 16:55:52 -08:00
committed by Carlos R. Mafra
parent 27d55b3e33
commit 3cd382bccc

View File

@@ -1144,11 +1144,7 @@ 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;
@@ -1161,10 +1157,24 @@ WWindow *wManageWindow(WScreen *scr, Window window)
head = wGetHeadForRect(scr, rect);
usableArea = wGetUsableAreaForHead(scr, head, NULL, True);
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;
/* 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;
}
}
/*