From c199bd6d18471123195bb239292923673a2351db Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 1 Oct 2011 18:34:49 +0000 Subject: [PATCH] Only forward scroll wheel events to siblings and not parents to work around wx weirdness Originally committed to SVN as r5702. --- aegisub/src/audio_display.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/aegisub/src/audio_display.cpp b/aegisub/src/audio_display.cpp index a589d3d65..7663a6fb2 100644 --- a/aegisub/src/audio_display.cpp +++ b/aegisub/src/audio_display.cpp @@ -1010,9 +1010,21 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) wxWindow *targetwindow = wxFindWindowAtPoint(event.GetPosition()); if (targetwindow && targetwindow != this) { - targetwindow->GetEventHandler()->ProcessEvent(event); - event.Skip(false); - return; + wxWindow *parent = GetParent(); + while (parent && parent != targetwindow) + { + parent = parent->GetParent(); + } + + // Don't forward scroll wheel events to parents of this as the + // target is sometimes reported as a parent even when the mouse + // is over the audio display + if (!parent) + { + targetwindow->GetEventHandler()->ProcessEvent(event); + event.Skip(false); + return; + } } }