mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-06-06 17:34:06 +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;
|
public Func<bool> CanMoveWindow = () => true;
|
||||||
|
|
||||||
private readonly Form owner;
|
protected readonly Form owner;
|
||||||
protected readonly ChromiumWebBrowser browser;
|
protected readonly ChromiumWebBrowser browser;
|
||||||
|
|
||||||
private int pauseCounter;
|
private int pauseCounter;
|
||||||
|
@ -96,8 +96,8 @@ private void StopMouseHook(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
private IntPtr MouseHookProc(int nCode, IntPtr wParam, IntPtr lParam){
|
private IntPtr MouseHookProc(int nCode, IntPtr wParam, IntPtr lParam){
|
||||||
if (wParam.ToInt32() == NativeMethods.WM_MOUSEWHEEL && browser.Bounds.Contains(PointToClient(Cursor.Position)) && !ContainsFocus){
|
if (wParam.ToInt32() == NativeMethods.WM_MOUSEWHEEL && browser.Bounds.Contains(PointToClient(Cursor.Position)) && !ContainsFocus && !owner.ContainsFocus){
|
||||||
browser.GetBrowser().GetHost().SendMouseWheelEvent(0, 0, 0, NativeMethods.GetHookWheelDelta(lParam), CefEventFlags.None);
|
browser.SendMouseWheelEvent(0, 0, 0, NativeMethods.GetHookWheelDelta(lParam), CefEventFlags.None);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NativeMethods.CallNextHookEx(mouseHook, nCode, wParam, lParam);
|
return NativeMethods.CallNextHookEx(mouseHook, nCode, wParam, lParam);
|
||||||
|
Loading…
Reference in New Issue
Block a user