From 48ff1a35559db25ece4ec8c7be4a930be58e2542 Mon Sep 17 00:00:00 2001 From: Xanfre Date: Thu, 9 May 2019 16:33:45 -0500 Subject: [PATCH 1/2] Fix the mouse cursor flicker exhibited when entering reader mode --- AngelLoader/CustomControls/RichTextBoxCustom.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/AngelLoader/CustomControls/RichTextBoxCustom.cs b/AngelLoader/CustomControls/RichTextBoxCustom.cs index e17a63046..4e089ba44 100644 --- a/AngelLoader/CustomControls/RichTextBoxCustom.cs +++ b/AngelLoader/CustomControls/RichTextBoxCustom.cs @@ -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: From 4967277bf80a3499ce689f1f373298d87d88a7dc Mon Sep 17 00:00:00 2001 From: Xanfre Date: Thu, 9 May 2019 20:24:16 -0500 Subject: [PATCH 2/2] Keep RichTextBox selectable after entering reader mode --- AngelLoader/CustomControls/RichTextBoxCustom.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AngelLoader/CustomControls/RichTextBoxCustom.cs b/AngelLoader/CustomControls/RichTextBoxCustom.cs index 4e089ba44..6739497de 100644 --- a/AngelLoader/CustomControls/RichTextBoxCustom.cs +++ b/AngelLoader/CustomControls/RichTextBoxCustom.cs @@ -445,14 +445,17 @@ protected override void WndProc(ref Message m) 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)