1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 15:49:41 +02:00

Work-around for bug 154

This commit is contained in:
BusinessmanProgrammerSteve 2010-04-14 18:32:03 +00:00
parent f4beb6856d
commit 830db47f50
4 changed files with 37 additions and 1 deletions

View File

@ -869,6 +869,11 @@ void AudacityApp::OnFatalException()
// main frame // main frame
bool AudacityApp::OnInit() bool AudacityApp::OnInit()
{ {
#if defined(__WXGTK__)
// Workaround for bug 154 -- initialize to false
inKbdHandler = false;
#endif
#if defined(__WXMAC__) #if defined(__WXMAC__)
// Disable window animation // Disable window animation
wxSystemOptions::SetOption( wxMAC_WINDOW_PLAIN_TRANSITION, 1 ); wxSystemOptions::SetOption( wxMAC_WINDOW_PLAIN_TRANSITION, 1 );

View File

@ -172,6 +172,13 @@ class AudacityApp:public wxApp {
Importer *mImporter; Importer *mImporter;
wxLogWindow *mLogger; wxLogWindow *mLogger;
#if defined(__WXGTK__)
/** \brief This flag is set true when in a keyboard event handler.
* Used to work around a hang issue with ibus (bug 154) */
bool inKbdHandler;
#endif
private: private:
CommandHandler *mCmdHandler; CommandHandler *mCmdHandler;
FileHistory *mRecentFiles; FileHistory *mRecentFiles;

View File

@ -1123,7 +1123,20 @@ bool LabelTrack::IsTextClipSupported()
CaptureEvents capture; CaptureEvents capture;
#endif #endif
return wxTheClipboard->IsSupported(wxDF_TEXT); #if defined(__WXGTK__)
// AWD: work-around for bug 154: do not call wxClipboard::IsSupported()
// when handling a keyboard event
if (!wxGetApp().inKbdHandler) {
#endif
return wxTheClipboard->IsSupported(wxDF_TEXT);
#if defined (__WXGTK__)
}
// In keyboard handler; return false for now
return false;
#endif
} }

View File

@ -4256,6 +4256,12 @@ void TrackPanel::OnKeyDown(wxKeyEvent & event)
/// Allow typing into LabelTracks. /// Allow typing into LabelTracks.
void TrackPanel::OnChar(wxKeyEvent & event) void TrackPanel::OnChar(wxKeyEvent & event)
{ {
#if defined (__WXGTK__)
// AWD: workaround for bug 154
bool restore = wxGetApp().inKbdHandler;
wxGetApp().inKbdHandler = true;
#endif
// Only deal with LabelTracks // Only deal with LabelTracks
Track *t = GetFocusedTrack(); Track *t = GetFocusedTrack();
if (!t || t->GetKind() != Track::Label) { if (!t || t->GetKind() != Track::Label) {
@ -4277,6 +4283,11 @@ void TrackPanel::OnChar(wxKeyEvent & event)
Refresh( false ); Refresh( false );
else if (!event.GetSkipped()) else if (!event.GetSkipped())
RefreshTrack(t); RefreshTrack(t);
#if defined (__WXGTK__)
// AWD: workaround for bug 154
wxGetApp().inKbdHandler = restore;
#endif
} }
/// Should handle the case when the mouse capture is lost. /// Should handle the case when the mouse capture is lost.