Skip to content

Commit

Permalink
Merge pull request #15 from Xanfre/master
Browse files Browse the repository at this point in the history
Fix the mouse cursor flicker exhibited when entering reader mode
  • Loading branch information
FenPhoenix authored May 10, 2019
2 parents 9441599 + 4967277 commit 560ec1a
Showing 1 changed file with 17 additions and 0 deletions.
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

0 comments on commit 560ec1a

Please sign in to comment.