diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-27 13:21:01 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-27 13:24:38 +0100 |
commit | d1a185f3af74ac4c6fe29e3d54c17133cd8d2db1 (patch) | |
tree | 0814813a06cb6d74830189b571e9baf6add10a20 /vcl/source/window/winproc.cxx | |
parent | d75049f9785db101d6ecb043a4576652b71da2a7 (diff) |
send wheel scroll events of disabled widgets to its enabled parent first
on scrolling with the wheel scroll if the pointer ends up over a disabled
widget then the event doesn't go to its parent and so the scrolling
halts unless the window happens to be the focus window
Change-Id: I57566b5c6e395e0f62d6b928f28e47a0c3486d65
Diffstat (limited to 'vcl/source/window/winproc.cxx')
-rw-r--r-- | vcl/source/window/winproc.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 1a343a67b8ac..e98f7ddc6a5c 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -1361,6 +1361,11 @@ static bool ImplCallWheelCommand( Window* pWindow, const Point& rPos, return false; } +static bool acceptableWheelScrollTarget(const Window *pMouseWindow) +{ + return (pMouseWindow && pMouseWindow->IsInputEnabled() && !pMouseWindow->IsInModalMode()); +} + static bool ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEvt, bool scaleDirectly = false ) { ImplDelData aDogTag( pWindow ); @@ -1418,8 +1423,15 @@ static bool ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv bIsFloat = true; } - if ( pMouseWindow && - pMouseWindow->IsEnabled() && pMouseWindow->IsInputEnabled() && ! pMouseWindow->IsInModalMode() ) + while (acceptableWheelScrollTarget(pMouseWindow)) + { + if (pMouseWindow->IsEnabled()) + break; + //try the parent if this one is disabled + pMouseWindow = pMouseWindow->GetParent(); + } + + if (acceptableWheelScrollTarget(pMouseWindow) && !pMouseWindow->IsInModalMode()) { // transform coordinates to float window frame coordinates Point aRelMousePos( pMouseWindow->OutputToScreenPixel( |