user32: Fix moving a caret
André Hentschel
nerv at dawncrow.de
Sun Sep 4 11:24:32 CDT 2011
This partially fixes http://bugs.winehq.org/show_bug.cgi?id=17196
in detail steps 5-7 from http://bugs.winehq.org/show_bug.cgi?id=17196#c6
---
dlls/user32/painting.c | 29 +++++------------------------
1 files changed, 5 insertions(+), 24 deletions(-)
diff --git a/dlls/user32/painting.c b/dlls/user32/painting.c
index c3a25fb..463deb9 100644
--- a/dlls/user32/painting.c
+++ b/dlls/user32/painting.c
@@ -807,23 +807,9 @@ static HWND fix_caret(HWND hWnd, const RECT *scroll_rect, INT dx, INT dy,
if (info.hwndCaret == hWnd)
{
- /* Move the caret if it's (partially) in the source rectangle */
- if (IntersectRect(&rect, scroll_rect, &info.rcCaret))
- {
- *move_caret = TRUE;
- hide_caret = TRUE;
- new_caret_pos->x = info.rcCaret.left + dx;
- new_caret_pos->y = info.rcCaret.top + dy;
- }
- else
- {
- *move_caret = FALSE;
-
- /* Hide the caret if it's in the destination rectangle */
- rect = *scroll_rect;
- OffsetRect(&rect, dx, dy);
- hide_caret = IntersectRect(&rect, &rect, &info.rcCaret);
- }
+ *move_caret = TRUE;
+ new_caret_pos->x = info.rcCaret.left + dx;
+ new_caret_pos->y = info.rcCaret.top + dy;
}
else
{
@@ -851,13 +837,8 @@ static HWND fix_caret(HWND hWnd, const RECT *scroll_rect, INT dx, INT dy,
return 0;
}
- if (hide_caret)
- {
- HideCaret(info.hwndCaret);
- return info.hwndCaret;
- }
- else
- return 0;
+ HideCaret(info.hwndCaret);
+ return info.hwndCaret;
}
--
Best Regards, André Hentschel
More information about the wine-patches
mailing list