diff --git a/Configuration/Arguments.cs b/Configuration/Arguments.cs index a1d6e63f..cf7f230b 100644 --- a/Configuration/Arguments.cs +++ b/Configuration/Arguments.cs @@ -7,7 +7,6 @@ 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 796ec5c9..10bf22b7 100644 --- a/Core/Notification/FormNotificationMain.cs +++ b/Core/Notification/FormNotificationMain.cs @@ -2,7 +2,6 @@ using System; using System.Drawing; using System.Windows.Forms; -using TweetDuck.Configuration; using TweetDuck.Core.Bridge; using TweetDuck.Core.Controls; using TweetDuck.Core.Handling; @@ -132,14 +131,7 @@ private IntPtr MouseHookProc(int nCode, IntPtr wParam, IntPtr lParam){ int eventType = wParam.ToInt32(); if (eventType == NativeMethods.WM_MOUSEWHEEL && IsCursorOverBrowser){ - 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); - } - + 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)){ diff --git a/Core/Utils/BrowserUtils.cs b/Core/Utils/BrowserUtils.cs index 85821417..83a6710f 100644 --- a/Core/Utils/BrowserUtils.cs +++ b/Core/Utils/BrowserUtils.cs @@ -22,7 +22,17 @@ public static void SetupCefArgs(IDictionary<string, string> args){ args["disable-gpu-vsync"] = "1"; } - if (!Program.UserConfig.EnableSmoothScrolling){ + if (Program.UserConfig.EnableSmoothScrolling){ + args["disable-threaded-scrolling"] = "1"; + + if (args.TryGetValue("disable-features", out string disabledFeatures)){ + args["disable-features"] = "TouchpadAndWheelScrollLatching,"+disabledFeatures; + } + else{ + args["disable-features"] = "TouchpadAndWheelScrollLatching"; + } + } + else{ args["disable-smooth-scrolling"] = "1"; }