Alexandre Julliard : user32: Fix initial computation of client area in WM_NCCALCSIZE for RTL windows.
Alexandre Julliard
julliard at winehq.org
Fri Sep 24 11:43:45 CDT 2010
Module: wine
Branch: master
Commit: deb830976093418238e7de9722f90b3463a84ccb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=deb830976093418238e7de9722f90b3463a84ccb
Author: Alexandre Julliard <julliard at winehq.org>
Date: Fri Sep 24 12:46:02 2010 +0200
user32: Fix initial computation of client area in WM_NCCALCSIZE for RTL windows.
---
dlls/user32/controls.h | 2 +-
dlls/user32/defwnd.c | 2 +-
dlls/user32/nonclient.c | 8 ++++++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h
index c36db42..065daeb 100644
--- a/dlls/user32/controls.h
+++ b/dlls/user32/controls.h
@@ -167,7 +167,7 @@ extern void MENU_EndMenu(HWND) DECLSPEC_HIDDEN;
/* nonclient area */
extern LRESULT NC_HandleNCPaint( HWND hwnd , HRGN clip) DECLSPEC_HIDDEN;
extern LRESULT NC_HandleNCActivate( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
-extern LRESULT NC_HandleNCCalcSize( HWND hwnd, RECT *winRect ) DECLSPEC_HIDDEN;
+extern LRESULT NC_HandleNCCalcSize( HWND hwnd, WPARAM wParam, RECT *winRect ) DECLSPEC_HIDDEN;
extern LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN;
extern LRESULT NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
extern LRESULT NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam) DECLSPEC_HIDDEN;
diff --git a/dlls/user32/defwnd.c b/dlls/user32/defwnd.c
index e4f14b5..226b604 100644
--- a/dlls/user32/defwnd.c
+++ b/dlls/user32/defwnd.c
@@ -309,7 +309,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
}
case WM_NCCALCSIZE:
- return NC_HandleNCCalcSize( hwnd, (RECT *)lParam );
+ return NC_HandleNCCalcSize( hwnd, wParam, (RECT *)lParam );
case WM_WINDOWPOSCHANGING:
return WINPOS_HandleWindowPosChanging( hwnd, (WINDOWPOS *)lParam );
diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c
index f385445..cc52f38 100644
--- a/dlls/user32/nonclient.c
+++ b/dlls/user32/nonclient.c
@@ -410,7 +410,7 @@ BOOL WINAPI AdjustWindowRectEx( LPRECT rect, DWORD style, BOOL menu, DWORD exSty
*
* Handle a WM_NCCALCSIZE message. Called from DefWindowProc().
*/
-LRESULT NC_HandleNCCalcSize( HWND hwnd, RECT *winRect )
+LRESULT NC_HandleNCCalcSize( HWND hwnd, WPARAM wparam, RECT *winRect )
{
RECT tmpRect = { 0, 0, 0, 0 };
LRESULT result = 0;
@@ -451,7 +451,11 @@ LRESULT NC_HandleNCCalcSize( HWND hwnd, RECT *winRect )
- GetSystemMetrics(SM_CYEDGE));
if (style & WS_VSCROLL)
- if( winRect->right - winRect->left >= GetSystemMetrics(SM_CXVSCROLL)){
+ if (winRect->right - winRect->left >= GetSystemMetrics(SM_CXVSCROLL))
+ {
+ /* rectangle is in screen coords when wparam is false */
+ if (!wparam && (exStyle & WS_EX_LAYOUTRTL)) exStyle ^= WS_EX_LEFTSCROLLBAR;
+
if((exStyle & WS_EX_LEFTSCROLLBAR) != 0)
winRect->left += GetSystemMetrics(SM_CXVSCROLL);
else
More information about the wine-cvs
mailing list