diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 596ab3c6b3..f16643b0c7 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -97,11 +97,9 @@ static gint gtk_text_focus_in_callback( GtkWidget *widget, GdkEvent *WXUNUSED(ev g_focusWindow = win; - wxPanel *panel = wxDynamicCast(win->GetParent(), wxPanel); - if (panel) - { - panel->SetLastFocus(win); - } + // notify the parent that we got the focus + wxChildFocusEvent eventFocus(win); + (void)win->GetEventHandler()->ProcessEvent(eventFocus); #ifdef HAVE_XIM if (win->m_ic) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 9dac9b8c8f..8a1f5c0cb9 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1694,8 +1694,8 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, // notify the parent keeping track of focus for the kbd navigation // purposes that we got it - wxChildFocusEvent eventFocus(this); - (void)GetEventHandler()->ProcessEvent(eventFocus); + wxChildFocusEvent eventFocus(win); + (void)win->GetEventHandler()->ProcessEvent(eventFocus); #ifdef HAVE_XIM if (win->m_ic) diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 596ab3c6b3..f16643b0c7 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -97,11 +97,9 @@ static gint gtk_text_focus_in_callback( GtkWidget *widget, GdkEvent *WXUNUSED(ev g_focusWindow = win; - wxPanel *panel = wxDynamicCast(win->GetParent(), wxPanel); - if (panel) - { - panel->SetLastFocus(win); - } + // notify the parent that we got the focus + wxChildFocusEvent eventFocus(win); + (void)win->GetEventHandler()->ProcessEvent(eventFocus); #ifdef HAVE_XIM if (win->m_ic) diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 9dac9b8c8f..8a1f5c0cb9 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -1694,8 +1694,8 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, // notify the parent keeping track of focus for the kbd navigation // purposes that we got it - wxChildFocusEvent eventFocus(this); - (void)GetEventHandler()->ProcessEvent(eventFocus); + wxChildFocusEvent eventFocus(win); + (void)win->GetEventHandler()->ProcessEvent(eventFocus); #ifdef HAVE_XIM if (win->m_ic)