From c7e95ac42e826cc1fefb2ad9b9cdfae429688205 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 2 Sep 2021 21:56:02 +0200 Subject: [PATCH] Post WM_MOUSELEAVE after WM_MOUSEMOVE when cleaning up the notification area This may be a fix for #350 and #426. If not enough, another solution could be to disable the tooltip for a limited amount of time (attach to PreviewTrayToolTipOpen, check for the last cleanup time in the delegate, set e.Handled if too early). --- src/wincompose/interop/WinTypes.cs | 1 + src/wincompose/ui/NotificationIcon.xaml.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/wincompose/interop/WinTypes.cs b/src/wincompose/interop/WinTypes.cs index 42687e4c..afcbe25b 100644 --- a/src/wincompose/interop/WinTypes.cs +++ b/src/wincompose/interop/WinTypes.cs @@ -43,6 +43,7 @@ internal enum WM : int SYSKEYDOWN = 0x104, SYSKEYUP = 0x105, MOUSEMOVE = 0x200, + MOUSELEAVE = 0x2A3, }; public enum VK : int diff --git a/src/wincompose/ui/NotificationIcon.xaml.cs b/src/wincompose/ui/NotificationIcon.xaml.cs index 1decf80e..b7bd90de 100644 --- a/src/wincompose/ui/NotificationIcon.xaml.cs +++ b/src/wincompose/ui/NotificationIcon.xaml.cs @@ -187,6 +187,7 @@ private void CleanupNotificationArea() for (int y = rect.Top + 4; y < rect.Bottom; y += 8) for (int x = rect.Left + 4; x < rect.Right; x += 8) NativeMethods.PostMessage(area, (uint)WM.MOUSEMOVE, 0, (y << 16) | x); + NativeMethods.PostMessage(area, (uint)WM.MOUSELEAVE, 0, 0); } }