From 6850d91fa4d0e0f8760e7e01267c1aac7a767676 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 18 Aug 2007 11:02:42 +0000 Subject: [PATCH] Left click only focuses if the event wasn't handled git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/window.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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