diff --git a/Configuration/Arguments.cs b/Configuration/Arguments.cs index cf7f230b..a1d6e63f 100644 --- a/Configuration/Arguments.cs +++ b/Configuration/Arguments.cs @@ -7,6 +7,7 @@ static class Arguments{ public const string ArgDataFolder = "-datafolder"; public const string ArgLogging = "-log"; public const string ArgIgnoreGDPR = "-nogdpr"; + public const string ArgNotificationScrollWA = "-nscrollwa"; // internal args public const string ArgRestart = "-restart"; diff --git a/Core/Notification/FormNotificationMain.cs b/Core/Notification/FormNotificationMain.cs index 8524fdb3..6a779494 100644 --- a/Core/Notification/FormNotificationMain.cs +++ b/Core/Notification/FormNotificationMain.cs @@ -2,6 +2,7 @@ using System; using System.Drawing; using System.Windows.Forms; +using TweetDuck.Configuration; using TweetDuck.Core.Bridge; using TweetDuck.Core.Controls; using TweetDuck.Core.Handling; @@ -136,7 +137,14 @@ private IntPtr MouseHookProc(int nCode, IntPtr wParam, IntPtr lParam){ int eventType = wParam.ToInt32(); if (eventType == NativeMethods.WM_MOUSEWHEEL && IsCursorOverBrowser){ - browser.SendMouseWheelEvent(0, 0, 0, BrowserUtils.Scale(NativeMethods.GetMouseHookData(lParam), Program.UserConfig.NotificationScrollSpeed*0.01), CefEventFlags.None); + if (Arguments.HasFlag(Arguments.ArgNotificationScrollWA)){ + int delta = BrowserUtils.Scale(NativeMethods.GetMouseHookData(lParam), Program.UserConfig.NotificationScrollSpeed*0.01); + browser.ExecuteScriptAsync("window.scrollBy", 0, -Math.Round(delta/0.72)); + } + else{ + browser.SendMouseWheelEvent(0, 0, 0, BrowserUtils.Scale(NativeMethods.GetMouseHookData(lParam), Program.UserConfig.NotificationScrollSpeed*0.01), CefEventFlags.None); + } + return NativeMethods.HOOK_HANDLED; } else if (eventType == NativeMethods.WM_XBUTTONDOWN && DesktopBounds.Contains(Cursor.Position)){