crashreport: 644837b5-c445-4779-a75d-dd69fc2e3a6f

drop hint of previous window to get mouse wheel event
when that window is disposed in order to drop any
references to it immediately that happens to avoid
anything else lingering too late

move the VclPtr into ImplSVData alongside the rest
of the things like this so we can remove the over-the-top
DeleteOnDeinit which itself replaced a relatively harmless
static Window*

Change-Id: I1e172071b711b6e4ded9a813ee3de730d3dfdf38
This commit is contained in:
Caolán McNamara
2016-06-15 21:05:50 +01:00
parent df14999784
commit bdfccfde30
3 changed files with 11 additions and 6 deletions

View File

@@ -193,6 +193,7 @@ struct ImplSVWinData
AutoTimer* mpTrackTimer; // tracking timer AutoTimer* mpTrackTimer; // tracking timer
ImageList* mpMsgBoxImgList; // ImageList for MessageBox ImageList* mpMsgBoxImgList; // ImageList for MessageBox
VclPtr<vcl::Window> mpAutoScrollWin; // window, that is in AutoScrollMode mode VclPtr<vcl::Window> mpAutoScrollWin; // window, that is in AutoScrollMode mode
VclPtr<vcl::Window> mpLastWheelWindow; // window, that last received a mouse wheel event
StartTrackingFlags mnTrackFlags; // tracking flags StartTrackingFlags mnTrackFlags; // tracking flags
StartAutoScrollFlags mnAutoScrollFlags; // auto scroll flags StartAutoScrollFlags mnAutoScrollFlags; // auto scroll flags
bool mbNoDeactivate; // true: do not execute Deactivate bool mbNoDeactivate; // true: do not execute Deactivate

View File

@@ -477,6 +477,10 @@ void Window::dispose()
if( pSVData->maWinData.mpActiveApplicationFrame == this ) if( pSVData->maWinData.mpActiveApplicationFrame == this )
pSVData->maWinData.mpActiveApplicationFrame = nullptr; 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 // reset marked windows
if ( mpWindowImpl->mpFrameData != nullptr ) if ( mpWindowImpl->mpFrameData != nullptr )
{ {

View File

@@ -1475,27 +1475,27 @@ public:
bool HandleWheelEvent::HandleEvent(const SalWheelMouseEvent& rEvt) bool HandleWheelEvent::HandleEvent(const SalWheelMouseEvent& rEvt)
{ {
static SalWheelMouseEvent aPreviousEvent; static SalWheelMouseEvent aPreviousEvent;
static vcl::DeleteOnDeinit< VclPtr<vcl::Window> > xPreviousWindow( new VclPtr<vcl::Window> );
if (!Setup()) if (!Setup())
return false; return false;
VclPtr<vcl::Window> xMouseWindow = FindTarget(); VclPtr<vcl::Window> xMouseWindow = FindTarget();
ImplSVData* pSVData = ImplGetSVData();
// avoid the problem that scrolling via wheel to this point brings a widget // 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 // under the mouse that also accepts wheel commands, so stick with the old
// widget if the time gap is very small // widget if the time gap is very small
VclPtr<vcl::Window> tmp = *xPreviousWindow.get(); if (shouldReusePreviousMouseWindow(aPreviousEvent, rEvt) && acceptableWheelScrollTarget(pSVData->maWinData.mpLastWheelWindow))
if (shouldReusePreviousMouseWindow(aPreviousEvent, rEvt) && acceptableWheelScrollTarget(tmp))
{ {
xMouseWindow = tmp; xMouseWindow = pSVData->maWinData.mpLastWheelWindow;
} }
aPreviousEvent = rEvt; aPreviousEvent = rEvt;
(*xPreviousWindow.get()) = Dispatch(xMouseWindow); pSVData->maWinData.mpLastWheelWindow = Dispatch(xMouseWindow);
return *xPreviousWindow.get(); return pSVData->maWinData.mpLastWheelWindow.get();
} }
class HandleGestureEvent : public HandleGestureEventBase class HandleGestureEvent : public HandleGestureEventBase