From: H.G. Muller Date: Sat, 13 Jun 2009 16:22:02 +0000 (-0700) Subject: fixed -stickyWindows option X-Git-Tag: v4.4.0.alpha6~5 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=10122705035fb2baa9ce2dcfd387efadef14ca85;p=xboard.git fixed -stickyWindows option I figured out why -stickyWindows was not working in XP and Vista (while it always worked under Win2K), and I think I found a fix for it that works under all Windows versions. (I tried XP and Win2K.) --- diff --git a/winboard/winboard.c b/winboard/winboard.c index 49df8ee..9d244c6 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -6275,6 +6275,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* [AS] Also move "attached" child windows */ case WM_WINDOWPOSCHANGING: + if( hwnd == hwndMain && appData.useStickyWindows ) { LPWINDOWPOS lpwp = (LPWINDOWPOS) lParam; @@ -6282,11 +6283,17 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* Window is moving */ RECT rcMain; - GetWindowRect( hwnd, &rcMain ); +// GetWindowRect( hwnd, &rcMain ); //[HGM] sticky: in XP this returned new position, not old + rcMain.left = boardX; // replace by these 4 lines to reconstruct old rect + rcMain.right = boardX + winWidth; + rcMain.top = boardY; + rcMain.bottom = boardY + winHeight; ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, moveHistoryDialog, &wpMoveHistory ); ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, evalGraphDialog, &wpEvalGraph ); ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, engineOutputDialog, &wpEngineOutput ); + boardX = lpwp->x; + boardY = lpwp->y; } } break;