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

Revert "Prevent border drifting."

This reverts commit df601267e6.

Conflicts:
	src/window.c
This commit is contained in:
Carlos R. Mafra
2012-12-18 18:18:14 +00:00
parent 0a461416e3
commit ff52ef3996
2 changed files with 7 additions and 24 deletions

View File

@@ -83,8 +83,6 @@ void wClientRestore(WWindow * wwin)
#endif #endif
/* account for titlebar and border */ /* account for titlebar and border */
wwin->frame_y += wwin->frame->top_width; wwin->frame_y += wwin->frame->top_width;
wwin->frame_x -= wwin->old_border_width;
wwin->frame_y -= wwin->old_border_width;
if (HAS_BORDER(wwin)) { if (HAS_BORDER(wwin)) {
wwin->frame_x += FRAME_BORDER_WIDTH; wwin->frame_x += FRAME_BORDER_WIDTH;
wwin->frame_y += FRAME_BORDER_WIDTH; wwin->frame_y += FRAME_BORDER_WIDTH;

View File

@@ -1172,17 +1172,8 @@ WWindow *wManageWindow(WScreen *scr, Window window)
} }
} }
/* If this is a newly-mapped window which had a border, /*
* the absolute co-ordinates reported to us are actually * wWindowConfigure() will init the client window's size
* the co-ordinates of the border. We, however, track
* the absolute co-ordinates of the client window, offset
* by the title bar and frame border. As a result
* we need to offset placement of the client by the border
* size so its position matches what we expect. */
x += wwin->old_border_width;
y += wwin->old_border_width;
/* wWindowConfigure() will init the client window's size
* (wwin->client.{width,height}) and all other geometry * (wwin->client.{width,height}) and all other geometry
* related variables (frame_x,frame_y) */ * related variables (frame_x,frame_y) */
wWindowConfigure(wwin, x, y, width, height); wWindowConfigure(wwin, x, y, width, height);
@@ -2222,9 +2213,7 @@ void wWindowConfigureBorders(WWindow *wwin)
{ {
if (wwin->frame) { if (wwin->frame) {
int flags; int flags;
int newx, newy, oldh; int newy, oldh;
int border_width;
XWindowAttributes attr;
flags = WFF_LEFT_BUTTON | WFF_RIGHT_BUTTON; flags = WFF_LEFT_BUTTON | WFF_RIGHT_BUTTON;
@@ -2242,17 +2231,13 @@ void wWindowConfigureBorders(WWindow *wwin)
if (wwin->flags.shaded) if (wwin->flags.shaded)
flags |= WFF_IS_SHADED; flags |= WFF_IS_SHADED;
if (!XGetWindowAttributes(dpy, wwin->frame->core->window, &attr)) oldh = wwin->frame->top_width;
attr.border_width = 0;
border_width = (flags & WFF_BORDER) ? FRAME_BORDER_WIDTH : 0;
oldh = wwin->frame->top_width + attr.border_width;
wFrameWindowUpdateBorders(wwin->frame, flags); wFrameWindowUpdateBorders(wwin->frame, flags);
if (oldh != wwin->frame->top_width + border_width) { if (oldh != wwin->frame->top_width) {
newx = wwin->frame_x + attr.border_width - border_width; newy = wwin->frame_y + oldh - wwin->frame->top_width;
newy = wwin->frame_y + oldh - border_width - wwin->frame->top_width;
XMoveWindow(dpy, wwin->client_win, 0, wwin->frame->top_width); XMoveWindow(dpy, wwin->client_win, 0, wwin->frame->top_width);
wWindowConfigure(wwin, newx, newy, wwin->client.width, wwin->client.height); wWindowConfigure(wwin, wwin->frame_x, newy, wwin->client.width, wwin->client.height);
} }
flags = 0; flags = 0;