1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-30 23:23:44 +02:00

See bug #294 for details

This commit is contained in:
lllucius 2011-03-11 14:56:36 +00:00
parent d1d5a1e3a9
commit 36fe24cdd8
2 changed files with 2 additions and 33 deletions

View File

@ -1728,31 +1728,6 @@ void AudacityProject::OnUpdateUI(wxUpdateUIEvent & event)
UpdateMenus();
}
#if defined(__WXGTK__)
// Under wxGTK, we seem to experience focus issues related to improper "buffering" of active focus. This causes
// the normal SetFocus() to be ignored if it thinks the target window already has focus, even though it may not
// really have it.
//
// Thus the reason for this hackage. It basically, forces focus to another, known to exist, window before
// forcing focus to the TrackPanel. This is not at all a perfect solution, but until wxGTK is fixed, this
// may provide some relief from focus not returning to the TrackPanel after modal dialogs are closed.
//
// This also means that it may not work the same way on different versions of wxGTK other than 2.8.11, which
// is the version this was tested on.
void AudacityProject::SetFocus()
{
if (mTrackPanel) {
wxWindow *w = GetSelectionBar();
if (w)
{
w->SetFocus();
OnInternalIdle();
}
mTrackPanel->SetFocus();
}
}
#endif
void AudacityProject::OnActivate(wxActivateEvent & event)
{
// Activate events can fire during window teardown, so just
@ -1764,9 +1739,8 @@ void AudacityProject::OnActivate(wxActivateEvent & event)
mActive = event.GetActive();
#if defined(__WXGTK__)
// See AudacityProject::SetFocus() above for further wxGTK handling
event.Skip();
return;
// See bug #294 for explanation
mTrackPanel->SetFocus();
#endif
// Under Windows, focus can be "lost" when returning to

View File

@ -127,11 +127,6 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
const wxPoint & pos, const wxSize & size);
virtual ~AudacityProject();
#if defined(__WXGTK__)
// See comments in Project.cpp/AudacityProject::SetFocus()
virtual void SetFocus();
#endif
TrackList *GetTracks() { return mTracks; };
UndoManager *GetUndoManager() { return &mUndoManager; }