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:
parent
cc3895c423
commit
538b2d26cd
Core/Notification
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user