Skip to content

Commit

Permalink
Fix the mouse cursor flicker exhibited when entering reader mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanfre committed May 9, 2019
1 parent 815793b commit 48ff1a3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions AngelLoader/CustomControls/RichTextBoxCustom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,23 @@ 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);
break;
case InteropMisc.WM_MBUTTONUP:
this.SetStyle(ControlStyles.Selectable, false);
DefWndProc(ref m);
break;
case InteropMisc.WM_MBUTTONDBLCLK:
this.SetStyle(ControlStyles.Selectable, false);
DefWndProc(ref m);
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

0 comments on commit 48ff1a3

Please sign in to comment.