Open Lydia-Shi opened 4 years ago
Unfortunately the flicker is by design, see comment in WM_CURSOR
handler of RichTextBox
The implementation forwards WM_CURSOR
to the native control in an attempt to observe its behavior. It tries to suppress it but obviously is not successful in doing so because suppression only happens when over links - outside links you get standard native behavior.
The result is that you have two places setting the "default" cursor, the native default cursor over selection is an arrow cursor, the managed default of TextBoxBase
does not differentiate between selection and always uses IBeam
. You'd get even more flicker if the user provided cursor customization since then the managed and native side would disagree even more.
If you want to get rid of flicker you need to decide on who is in charge, either the native control or the managed control, having two sides providing cursors always will lead to flicker when they do not agree.
Ideally you would be able to detect if the user does cursor customization and if not you'd just let the native control take charge. If there is cursor customization you'd no longer forward WM_CURSOR to the native control and always use the users cursor decision. I don't know how easy it is to differentiate between these two cases.
If you can't differentiate then you have to drop native defaults and reimplement link handling without forwarding WM_CURSOR (or just live with the flicker as 'by design')
This issue is now marked as "up for grabs", and we’re looking for a community volunteer to work on this issue. If we receive no interest in 120 days, we will close the issue. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
.NET Core Version: 3.1.300-preview-015095
Have you experienced this same bug with .NET Framework?: Yes
Minimal repro:
Or Run the attached project CursorFlickerPrj.zip and repeat step4 & step5.
Expected behavior: The cursor is not flicker.
Actual behavior: The cursor is flicker.![Flicker333](https://user-images.githubusercontent.com/54019172/79296351-c7b43580-7f0d-11ea-9fd2-afb2e717510c.gif)