From 45bcb345e8770f0cf650c9c2cf0ed3bcfc4ae233 Mon Sep 17 00:00:00 2001 From: icarter09 Date: Tue, 11 Feb 2020 23:29:59 -0500 Subject: [PATCH] Added logic to check if the focus need to be set. Squashed formatting commits. --- xed/xed-highlight-mode-selector.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xed/xed-highlight-mode-selector.c b/xed/xed-highlight-mode-selector.c index f0ccd1b..42efccb 100644 --- a/xed/xed-highlight-mode-selector.c +++ b/xed/xed-highlight-mode-selector.c @@ -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);