diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index b94c810fa9..1ecbb92af9 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1464,11 +1464,6 @@ gtk_window_button_press_callback( GtkWidget *widget, g_lastButtonNumber = gdk_event->button; - if (win->m_wxwindow && (g_focusWindow != win) && win->AcceptsFocus()) - { - gtk_widget_grab_focus( win->m_wxwindow ); - } - // GDK sends surplus button down events // before a double click event. We // need to filter these out. @@ -1599,6 +1594,12 @@ gtk_window_button_press_callback( GtkWidget *widget, if ( ret ) return TRUE; + if ((event_type == wxEVT_LEFT_DOWN) && + (g_focusWindow != win) && win->AcceptsFocus()) + { + win->SetFocus(); + } + if (event_type == wxEVT_RIGHT_DOWN) { // generate a "context menu" event: this is similar to right mouse