1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-06 14:34:05 +02:00

Tweak notification scroll hook to not trigger when main window is focused

This commit is contained in:
chylex 2017-04-04 16:43:22 +02:00
parent cc3895c423
commit 538b2d26cd
2 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ public bool IsNotificationVisible{
public Func<bool> CanMoveWindow = () => true;
private readonly Form owner;
protected readonly Form owner;
protected readonly ChromiumWebBrowser browser;
private int pauseCounter;

View File

@ -96,8 +96,8 @@ private void StopMouseHook(){
}
private IntPtr MouseHookProc(int nCode, IntPtr wParam, IntPtr lParam){
if (wParam.ToInt32() == NativeMethods.WM_MOUSEWHEEL && browser.Bounds.Contains(PointToClient(Cursor.Position)) && !ContainsFocus){
browser.GetBrowser().GetHost().SendMouseWheelEvent(0, 0, 0, NativeMethods.GetHookWheelDelta(lParam), CefEventFlags.None);
if (wParam.ToInt32() == NativeMethods.WM_MOUSEWHEEL && browser.Bounds.Contains(PointToClient(Cursor.Position)) && !ContainsFocus && !owner.ContainsFocus){
browser.SendMouseWheelEvent(0, 0, 0, NativeMethods.GetHookWheelDelta(lParam), CefEventFlags.None);
}
return NativeMethods.CallNextHookEx(mouseHook, nCode, wParam, lParam);