diff options
author | Nelson Benítez León <nbenitezl@gmail.com> | 2023-05-03 00:36:49 -0400 |
---|---|---|
committer | Nelson Benítez León <nbenitezl@gmail.com> | 2023-05-03 00:36:49 -0400 |
commit | 5b11e9c4e6369fc6904724b5fb45def4f083f0b6 (patch) | |
tree | ab850c7cbe57878bbf070c873257b20119afb769 | |
parent | abd7a08aa9065470ff69cf62d917b76b16f77b66 (diff) | |
download | gnome-control-center-fix_activating_first_row.tar.gz |
CcPanelList: don't activate first row panel unnecesarilyfix_activating_first_row
Don't activate first row panel (i.e. 'Wifi') when:
- Canceling search view (pressing ESC or deleting all query text).
- Activating a search result from search view.
Closes #2472
-rw-r--r-- | shell/cc-panel-list.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/shell/cc-panel-list.c b/shell/cc-panel-list.c index 223f06291..299ba8015 100644 --- a/shell/cc-panel-list.c +++ b/shell/cc-panel-list.c @@ -227,15 +227,10 @@ update_search (CcPanelList *self) GtkSelectionMode selection_mode; gboolean autoselect_panel; - /* Autoselect panel only if allowed. Autoselect of - * panel isn’t allowed if the panel is folded */ - autoselect_panel = self->autoselect_panel; - selection_mode = gtk_list_box_get_selection_mode (GTK_LIST_BOX (self->main_listbox)); - self->autoselect_panel = selection_mode != GTK_SELECTION_NONE; + /* Don't autoselect first panel when going back from search view */ + self->autoselect_panel = FALSE; switch_to_view (self, self->previous_view); - - self->autoselect_panel = autoselect_panel; } gtk_list_box_invalidate_filter (GTK_LIST_BOX (self->search_listbox)); @@ -645,6 +640,10 @@ search_row_activated_cb (GtkWidget *listbox, gtk_list_box_select_row (GTK_LIST_BOX (real_listbox), real_row); gtk_widget_grab_focus (GTK_WIDGET (real_row)); + /* Don't autoselect first panel because we are already + * activating a panel from search result */ + self->autoselect_panel = FALSE; + g_signal_emit_by_name (real_row, "activate"); break; } |