Merge branch 'gtk-combo-focus'

Fix spurious focus loss events for wxGTK comboboxes.

See https://github.com/wxWidgets/wxWidgets/pull/714
This commit is contained in:
Vadim Zeitlin
2018-02-04 14:52:27 +01:00
5 changed files with 29 additions and 15 deletions

View File

@@ -111,6 +111,23 @@ wxChoice::~wxChoice()
#endif // __WXGTK3__
}
bool wxChoice::GTKHandleFocusOut()
{
if ( wx_is_at_least_gtk2(10) )
{
gboolean isShown;
g_object_get( m_widget, "popup-shown", &isShown, NULL );
// Don't send "focus lost" events if the focus is grabbed by our own
// popup, it counts as part of this window, even though wx doesn't know
// about it (and can't, because GtkComboBox doesn't expose it).
if ( isShown )
return true;
}
return wxChoiceBase::GTKHandleFocusOut();
}
void wxChoice::GTKInsertComboBoxTextItem( unsigned int n, const wxString& text )
{
#ifdef __WXGTK3__