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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions AngelLoader/CustomControls/RichTextBoxCustom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,26 @@ protected override void WndProc(ref Message m)
{
switch ((uint)m.Msg)
{
// Intercept the mousewheel call and direct direct it to use the fixed scrolling
case InteropMisc.WM_MOUSEWHEEL:
InterceptMousewheel(ref m);
break;
// Fix the flickering that is present when reader mode is entered
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;
// The below DefWndProc() call essentially "calls" this section, and this section "returns" whether
// the cursor was over a link (via LinkCursor)
case InteropMisc.WM_REFLECT + InteropMisc.WM_NOTIFY:
Expand Down