From 38758f72ac0b6a277a9c3f98826ae0b694d264ca Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 25 Feb 2014 05:29:00 +0000 Subject: [PATCH] [Win32ss] - MapWindowPoints return incorrect result for windows with WS_EX_LAYOUTRTL style. - Patch by Maxim Andreyanov. see CORE-7947. svn path=/trunk/; revision=62327 --- reactos/win32ss/user/ntuser/window.c | 11 +++++++++++ reactos/win32ss/user/ntuser/winpos.c | 2 -- reactos/win32ss/user/user32/windows/winpos.c | 2 -- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index 91feae4df56..e0e57643c5a 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -2313,6 +2313,17 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs, ParentWindow->rcClient.top); } */ + /* correct child window coordinates if mirroring on parent is enabled */ + if (ParentWindow != NULL) + { + if ( ((Cs->style & WS_CHILD) == WS_CHILD) && + ((ParentWindow->ExStyle & WS_EX_LAYOUTRTL) == WS_EX_LAYOUTRTL)) + { + Window->rcWindow.right = ParentWindow->rcClient.right - (Window->rcWindow.left - ParentWindow->rcClient.left); + Window->rcWindow.left = Window->rcWindow.right - Size.cx; + } + } + Window->rcClient = Window->rcWindow; /* Link the window */ diff --git a/reactos/win32ss/user/ntuser/winpos.c b/reactos/win32ss/user/ntuser/winpos.c index ab2c722b92c..da0f7e8f985 100644 --- a/reactos/win32ss/user/ntuser/winpos.c +++ b/reactos/win32ss/user/ntuser/winpos.c @@ -120,8 +120,6 @@ IntMapWindowPoints(PWND FromWnd, PWND ToWnd, LPPOINT lpPoints, UINT cPoints) Delta.y -= ToWnd->rcClient.top; } - if (mirror_from) Delta.x = -Delta.x; - for (i = 0; i != cPoints; i++) { lpPoints[i].x += Delta.x; diff --git a/reactos/win32ss/user/user32/windows/winpos.c b/reactos/win32ss/user/user32/windows/winpos.c index 8917ea4718f..30b43f7199b 100644 --- a/reactos/win32ss/user/user32/windows/winpos.c +++ b/reactos/win32ss/user/user32/windows/winpos.c @@ -218,8 +218,6 @@ MapWindowPoints(HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints) Delta.y -= ToWnd->rcClient.top; } - if (mirror_from) Delta.x = -Delta.x; - for (i = 0; i != cPoints; i++) { lpPoints[i].x += Delta.x;