From 10122705035fb2baa9ce2dcfd387efadef14ca85 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 13 Jun 2009 09:22:02 -0700 Subject: [PATCH] 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.) --- winboard/winboard.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) 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; -- 1.7.0.4