Added logic to check if the focus need to be set. Squashed formatting commits.

This commit is contained in:
icarter09 2020-02-11 23:29:59 -05:00 committed by Michael Webster
parent d1833f6591
commit 45bcb345e8
1 changed files with 8 additions and 2 deletions

View File

@ -244,7 +244,14 @@ static void
on_entry_realized (GtkWidget *entry,
XedHighlightModeSelector *selector)
{
gtk_widget_grab_focus (entry);
if (gtk_widget_is_focus (selector))
{
gtk_widget_grab_focus (entry);
}
else
{
gtk_widget_grab_focus (selector);
}
}
static void
@ -281,7 +288,6 @@ xed_highlight_mode_selector_init (XedHighlightModeSelector *selector)
G_CALLBACK (on_entry_key_press_event), selector);
g_signal_connect (selector->entry, "realize",
G_CALLBACK (on_entry_realized), selector);
g_signal_connect (selector->treeview, "row-activated",
G_CALLBACK (on_row_activated), selector);