From fffbe5228c154cae893dd4de301ea6db2a49e520 Mon Sep 17 00:00:00 2001 From: deepend-tildeclub <58404188+deepend-tildeclub@users.noreply.github.com> Date: Mon, 16 Feb 2026 03:05:43 -0700 Subject: [PATCH] Forward mouse wheel messages to hovered window Handle mouse wheel messages by forwarding them to the hovered window. --- src/fe-gtk/maingui.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 23114506..b9d1950d 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -4013,6 +4013,27 @@ mg_win32_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data) } } + if (msg->message == WM_MOUSEWHEEL || msg->message == WM_MOUSEHWHEEL) + { + POINT cursor_pos; + HWND hover_hwnd; + DWORD hover_pid = 0; + + if (!GetCursorPos (&cursor_pos)) + return GDK_FILTER_CONTINUE; + + hover_hwnd = WindowFromPoint (cursor_pos); + if (!hover_hwnd || hover_hwnd == msg->hwnd) + return GDK_FILTER_CONTINUE; + + GetWindowThreadProcessId (hover_hwnd, &hover_pid); + if (hover_pid != GetCurrentProcessId ()) + return GDK_FILTER_CONTINUE; + + PostMessage (hover_hwnd, msg->message, msg->wParam, msg->lParam); + return GDK_FILTER_REMOVE; + } + return GDK_FILTER_CONTINUE; } #endif