X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e4606ed9d0d0fb3c6b11e97185a66139ff703c35..625cb8c0b1ac12f26265cae2c69d7f510de0edb1:/src/gtk/window.cpp?ds=sidebyside diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 8dfbf2b096..8a1f5c0cb9 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -38,6 +38,10 @@ #include "wx/caret.h" #endif // wxUSE_CARET +#if wxUSE_TEXTCTRL +#include "wx/textctrl.h" +#endif + #include "wx/menu.h" #include "wx/statusbr.h" #include "wx/intl.h" @@ -1688,11 +1692,10 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, printf( ".\n" ); */ - wxPanel *panel = wxDynamicCast(win->GetParent(), wxPanel); - if (panel) - { - panel->SetLastFocus(win); - } + // notify the parent keeping track of focus for the kbd navigation + // purposes that we got it + wxChildFocusEvent eventFocus(win); + (void)win->GetEventHandler()->ProcessEvent(eventFocus); #ifdef HAVE_XIM if (win->m_ic) @@ -1708,6 +1711,16 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, } #endif // wxUSE_CARET +#if wxUSE_TEXTCTRL + // If it's a wxTextCtrl don't send the event as it will be done + // after the control gets to process it. + wxTextCtrl *ctrl = wxDynamicCast(win, wxTextCtrl); + if ( ctrl ) + { + return FALSE; + } +#endif + if (win->IsTopLevel()) { wxActivateEvent event( wxEVT_ACTIVATE, TRUE, win->GetId() ); @@ -1776,6 +1789,16 @@ static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEvent *WXUNUSED } #endif // wxUSE_CARET +#if wxUSE_TEXTCTRL + // If it's a wxTextCtrl don't send the event as it will be done + // after the control gets to process it. + wxTextCtrl *ctrl = wxDynamicCast(win, wxTextCtrl); + if ( ctrl ) + { + return FALSE; + } +#endif + if (win->IsTopLevel()) { wxActivateEvent event( wxEVT_ACTIVATE, FALSE, win->GetId() );