Only set focus to widget automatically if left down

event was not handled (as per wxMSW).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2007-04-26 18:45:16 +00:00
parent da1bd25f29
commit 8622e8cdce

View File

@@ -1579,6 +1579,12 @@ gtk_window_button_press_callback( GtkWidget *widget,
if ( ret )
return TRUE;
if ((event_type == wxEVT_LEFT_DOWN) && !win->IsOfStandardClass() &&
(g_focusWindow != win) && win->CanAcceptFocus())
{
gtk_widget_grab_focus( win->m_wxwindow );
}
if (event_type == wxEVT_RIGHT_DOWN)
{
// generate a "context menu" event: this is similar to right mouse
@@ -2076,9 +2082,6 @@ gtk_scrollbar_button_release_event(GtkRange* range, GdkEventButton*, wxWindow* w
// "realize" from m_widget
//-----------------------------------------------------------------------------
/* We cannot set colours and fonts before the widget has
been realized, so we do this directly after realization. */
static void
gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win )
{
@@ -2091,6 +2094,16 @@ gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win )
pizza->bin_window );
}
// We cannot set colours and fonts before the widget
// been realized, so we do this directly after realization
// or otherwise in idle time
if (win->m_needsStyleChange)
{
win->SetBackgroundStyle(win->GetBackgroundStyle());
win->m_needsStyleChange = false;
}
wxWindowCreateEvent event( win );
event.SetEventObject( win );
win->GTKProcessEvent( event );