diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 3542a670b4..976e127c42 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -647,7 +647,24 @@ void wxComboBox::OnChar( wxKeyEvent &event ) event.SetString( GetValue() ); event.SetInt( GetSelection() ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + + if (!GetEventHandler()->ProcessEvent( event )) + { + // This will invoke the dialog default action, such + // as the clicking the default button. + + wxWindow *top_frame = m_parent; + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) + top_frame = top_frame->GetParent(); + + if (top_frame && GTK_IS_WINDOW(top_frame->m_widget)) + { + GtkWindow *window = GTK_WINDOW(top_frame->m_widget); + + if (window->default_widget) + gtk_widget_activate (window->default_widget); + } + } // Catch GTK event so that GTK doesn't open the drop // down list upon RETURN. diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index dc03ce10db..a7ce14cfb5 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -370,7 +370,7 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) wxSetCursor( wxCursor(wxCURSOR_WATCH) ); if (wxTheApp) - wxTheApp->SendIdleEvents(); + wxTheApp->ProcessIdle(); gdk_flush(); } diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index 3542a670b4..976e127c42 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -647,7 +647,24 @@ void wxComboBox::OnChar( wxKeyEvent &event ) event.SetString( GetValue() ); event.SetInt( GetSelection() ); event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); + + if (!GetEventHandler()->ProcessEvent( event )) + { + // This will invoke the dialog default action, such + // as the clicking the default button. + + wxWindow *top_frame = m_parent; + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) + top_frame = top_frame->GetParent(); + + if (top_frame && GTK_IS_WINDOW(top_frame->m_widget)) + { + GtkWindow *window = GTK_WINDOW(top_frame->m_widget); + + if (window->default_widget) + gtk_widget_activate (window->default_widget); + } + } // Catch GTK event so that GTK doesn't open the drop // down list upon RETURN. diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp index dc03ce10db..a7ce14cfb5 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/cursor.cpp @@ -370,7 +370,7 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) wxSetCursor( wxCursor(wxCURSOR_WATCH) ); if (wxTheApp) - wxTheApp->SendIdleEvents(); + wxTheApp->ProcessIdle(); gdk_flush(); }