From e61e60ad2599fae5ad21e2a134b249ce97d7bfc0 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Fri, 21 Jul 2017 09:33:21 -0400 Subject: [PATCH] Update TrackPanel cursor for unmoving mouse, changing display... ... This fix might not be exhaust the possibilities. Some examples covered: When an undo state is pushed. For instance: Hover over bottom of sole track for resize cursor, then Shift+C to delete it. (Cursor change used to happen at Shift key up, now sooner. Maybe your shortcut does not include Shift.) When an undo state is modified without a push. For instance: hover over right edge of selection. Hit Shift+Ctrl+A to remove the selection. (Again, change cursor before keys up, and even if no modifiers in the shortcut.) When scrollbars change for any reason, such as pinned play or Shift+scrollwheel. (Clip boundaries may pass your mouse. Cursor change and also snap lines come and go.) --- src/Project.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Project.cpp b/src/Project.cpp index 6b5ce1ac9..b85f9d1a4 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -2031,6 +2031,9 @@ void AudacityProject::FixScrollbars() if (oldhstate != newhstate || oldvstate != newvstate) { UpdateLayout(); } + + CallAfter( + [this]{ GetTrackPanel()->HandleCursorForPresentMouseState(); } ); } std::shared_ptr AudacityProject::GetFirstVisible() @@ -2278,6 +2281,9 @@ void AudacityProject::DoScroll() if (!mAutoScrolling) { mTrackPanel->Refresh(false); } + + CallAfter( + [this]{ GetTrackPanel()->HandleCursorForPresentMouseState(); } ); } bool AudacityProject::ReportIfActionNotAllowed @@ -4490,6 +4496,8 @@ void AudacityProject::PushState(const wxString &desc, this->DoZoomFitV(); if((flags & UndoPush::AUTOSAVE) != UndoPush::MINIMAL) AutoSave(); + + GetTrackPanel()->HandleCursorForPresentMouseState(); } void AudacityProject::RollbackState() @@ -4502,6 +4510,7 @@ void AudacityProject::ModifyState(bool bWantsAutoSave) GetUndoManager()->ModifyState(GetTracks(), mViewInfo.selectedRegion, mTags); if (bWantsAutoSave) AutoSave(); + GetTrackPanel()->HandleCursorForPresentMouseState(); } // LL: Is there a memory leak here as "l" and "t" are not deleted???