diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 7e90096..96ab4aa 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1663,10 +1663,13 @@ static int ME_CalculateClickCount(HWND hWnd, UINT msg, WPARAM wParam, return clickNum; } -static BOOL ME_SetCursor(ME_TextEditor *editor, int x) +static BOOL ME_SetCursor(ME_TextEditor *editor) { + POINT pt; + GetCursorPos(&pt); + ScreenToClient(editor->hWnd, &pt); if ((GetWindowLongW(editor->hWnd, GWL_STYLE) & ES_SELECTIONBAR) && - (x < editor->selofs || + (pt.x < editor->selofs || (editor->nSelectionType == stLine && GetCapture() == editor->hWnd))) { SetCursor(hLeft); @@ -3031,6 +3034,11 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, ME_DestroyEditor(editor); SetWindowLongPtrW(hWnd, 0, 0); return 0; + case WM_SETCURSOR: + { + if (!ME_SetCursor(editor)) goto do_default; + return TRUE; + } case WM_LBUTTONDBLCLK: case WM_LBUTTONDOWN: { @@ -3043,7 +3051,6 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, ME_CalculateClickCount(hWnd, msg, wParam, lParam)); SetCapture(hWnd); ME_LinkNotify(editor,msg,wParam,lParam); - if (!ME_SetCursor(editor, LOWORD(lParam))) goto do_default; break; } case WM_MOUSEMOVE: @@ -3053,7 +3060,6 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, if (GetCapture() == hWnd) ME_MouseMove(editor, (short)LOWORD(lParam), (short)HIWORD(lParam)); ME_LinkNotify(editor,msg,wParam,lParam); - if (!ME_SetCursor(editor, LOWORD(lParam))) goto do_default; break; case WM_LBUTTONUP: if (GetCapture() == hWnd) @@ -3066,7 +3072,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, else { BOOL ret; - ret = ME_SetCursor(editor, LOWORD(lParam)); + ret = ME_SetCursor(editor); ME_LinkNotify(editor,msg,wParam,lParam); if (!ret) goto do_default; }