Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the mouse cursor flicker exhibited when entering reader mode #15

Merged
merged 2 commits into from
May 10, 2019
Merged

Conversation

Xanfre
Copy link
Contributor

@Xanfre Xanfre commented May 9, 2019

This was a simpler fix than expected and brief testing yields no known side effects, with the middle-mouse reader mode functionality acting intended with no visible mouse cursor flickering.

@FenPhoenix
Copy link
Owner

Very clean. Just one change I would ask for: After each DefWndProc call, set Selectable back to true, so like this:

case InteropMisc.WM_MBUTTONDOWN:
this.SetStyle(ControlStyles.Selectable, false);
DefWndProc(ref m);
this.SetStyle(ControlStyles.Selectable, true);
break;
case InteropMisc.WM_MBUTTONUP:
this.SetStyle(ControlStyles.Selectable, false);
DefWndProc(ref m);
this.SetStyle(ControlStyles.Selectable, true);
break;
case InteropMisc.WM_MBUTTONDBLCLK:
this.SetStyle(ControlStyles.Selectable, false);
DefWndProc(ref m);
this.SetStyle(ControlStyles.Selectable, true);
break;

Doing it like this, the flicker fix still works, but it also keeps the control selectable in case someone wants to use the Tab key to select it later (if you don't set Selectable back to true, it can never be keyboard-selected after the first middle-button click).

@FenPhoenix
Copy link
Owner

Great work on finding a fix so fast btw. Accepting.

@FenPhoenix FenPhoenix merged commit 560ec1a into FenPhoenix:master May 10, 2019
@Xanfre
Copy link
Contributor Author

Xanfre commented May 10, 2019

Once I researched how reader mode works, it was fairly straightforward to implement a simple fix. With this, I believe the RichTextBox control AngelLoader uses has been improved to a point to where no major issues remain, which is an accomplishment given how difficult it likes to be sometimes.

Thank you for considering these fixes.

@FenPhoenix
Copy link
Owner

No prob. You've really helped improve the experience, appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants