[1/2] richedit: Prevented cursor flicker while moving over selection bar

Alexandre Julliard julliard at winehq.org
Wed Jul 9 04:10:47 CDT 2008


"Dylan Smith" <dylan.ah.smith at gmail.com> writes:

> 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);

In general GetCursorPos should be avoided. It incurs an X server
round-trip, and it's asynchronous so the position may not match the
message you are currently processing. Something like GetMessagePos is
usually better.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list