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:
@@ -1579,6 +1579,12 @@ gtk_window_button_press_callback( GtkWidget *widget,
|
|||||||
if ( ret )
|
if ( ret )
|
||||||
return TRUE;
|
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)
|
if (event_type == wxEVT_RIGHT_DOWN)
|
||||||
{
|
{
|
||||||
// generate a "context menu" event: this is similar to right mouse
|
// 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
|
// "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
|
static void
|
||||||
gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win )
|
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 );
|
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 );
|
wxWindowCreateEvent event( win );
|
||||||
event.SetEventObject( win );
|
event.SetEventObject( win );
|
||||||
win->GTKProcessEvent( event );
|
win->GTKProcessEvent( event );
|
||||||
|
Reference in New Issue
Block a user