summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/window.cxx4
-rw-r--r--vcl/source/window/winproc.cxx11
2 files changed, 10 insertions, 5 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index bd2a66249877..2c4164eae76a 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -481,6 +481,10 @@ void Window::dispose()
if( pSVData->maWinData.mpActiveApplicationFrame == this )
pSVData->maWinData.mpActiveApplicationFrame = nullptr;
+ // reset hint of what was the last wheeled window
+ if( pSVData->maWinData.mpLastWheelWindow == this )
+ pSVData->maWinData.mpLastWheelWindow = nullptr;
+
// reset marked windows
if ( mpWindowImpl->mpFrameData != nullptr )
{
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 66e89448b798..fce0d799cf79 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1509,26 +1509,27 @@ public:
bool HandleWheelEvent::HandleEvent(const SalWheelMouseEvent& rEvt)
{
static SalWheelMouseEvent aPreviousEvent;
- static VclPtr<vcl::Window> xPreviousWindow;
if (!Setup())
return false;
VclPtr<vcl::Window> xMouseWindow = FindTarget();
+ ImplSVData* pSVData = ImplGetSVData();
+
// avoid the problem that scrolling via wheel to this point brings a widget
// under the mouse that also accepts wheel commands, so stick with the old
// widget if the time gap is very small
- if (shouldReusePreviousMouseWindow(aPreviousEvent, rEvt) && acceptableWheelScrollTarget(xPreviousWindow))
+ if (shouldReusePreviousMouseWindow(aPreviousEvent, rEvt) && acceptableWheelScrollTarget(pSVData->maWinData.mpLastWheelWindow))
{
- xMouseWindow = xPreviousWindow.get();
+ xMouseWindow = pSVData->maWinData.mpLastWheelWindow;
}
aPreviousEvent = rEvt;
- xPreviousWindow = Dispatch(xMouseWindow);
+ pSVData->maWinData.mpLastWheelWindow = Dispatch(xMouseWindow);
- return xPreviousWindow;
+ return pSVData->maWinData.mpLastWheelWindow.get();
}
class HandleGestureEvent : public HandleGestureEventBase