Re: [1/2] user32: Converted rcScrollBar to screen coordinates.
"Dylan Smith" <dylan.ah.smith(a)gmail.com> wrote:
@@ -1252,6 +1253,9 @@ static BOOL SCROLL_GetScrollBarInfo(HWND hwnd, LONG idObject, LPSCROLLBARINFO in
SCROLL_GetScrollBarRect(hwnd, nBar, &info->rcScrollBar, &nDummy, &info->dxyLineButton, &info->xyThumbTop); + /* rcScrollBar needs to be in screen coordinates */ + GetWindowRect(hwnd, &rect); + OffsetRect(&info->rcScrollBar, rect.left, rect.top);
You need to fix SCROLL_GetScrollBarRect for the SB_CTL case instead.
+static void scrollbar_test4(void) +{ + BOOL ret; + SCROLLBARINFO sbi; + RECT rect; + + /* Test GetScrollBarInfo to make sure it returns rcScrollBar in screen + * coordinates. */ + sbi.cbSize = sizeof(sbi); + ret = GetScrollBarInfo( hScroll, OBJID_CLIENT, &sbi); + ok( ret, "The GetScrollBarInfo() call should not fail.\n" ); + GetWindowRect( hScroll, &rect ); + ok( ret, "The GetWindowRect() call should not fail.\n" ); + ok( !(sbi.rgstate[0] & (STATE_SYSTEM_INVISIBLE|STATE_SYSTEM_OFFSCREEN)), + "unexpected rgstate(0x%x)\n", sbi.rgstate[0]); + ok( !memcmp(&rect, &sbi.rcScrollBar, sizeof(RECT)), + "WindowRect(%d, %d, %d, %d) != rcScrollBar(%d, %d, %d, %d)\n",
EqualRect is better than memcmp. -- Dmitry.
On Mon, Oct 6, 2008 at 2:17 AM, Dmitry Timoshkov <dmitry(a)codeweavers.com>wrote:
You need to fix SCROLL_GetScrollBarRect for the SB_CTL case instead.
SCROLL_GetScrollBarRect is used is used in multiple places where client coordinates are expected, and it isn't just the SB_CTL case that needs to be changed, in fact it was the SB_VERT case that I noticed first. EqualRect is better than memcmp.
Yup. I didn't know the function existed until now.
"Dylan Smith" <dylan.ah.smith(a)gmail.com> wrote:
You need to fix SCROLL_GetScrollBarRect for the SB_CTL case instead.
SCROLL_GetScrollBarRect is used is used in multiple places where client coordinates are expected, and it isn't just the SB_CTL case that needs to be changed, in fact it was the SB_VERT case that I noticed first.
Then you need to test the remaining cases as well. -- Dmitry.
participants (2)
-
Dmitry Timoshkov -
Dylan Smith