[gnome-control-center/panels-display-fix-primary-monitor-selection: 8/8] display: Fix primary monitor selection issue with AdwComboRow




commit 37921f8a469fcbb78bb44d3f7d6fd403622e4423
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Aug 23 17:31:31 2022 +0200

    display: Fix primary monitor selection issue with AdwComboRow
    
    We were connecting to the selected-index property when AdwComboRow
    actually has a selected-item property. This is the same as
    issue #2025
    
    Fixes #2028

 panels/display/cc-display-panel.c  | 4 ++--
 panels/display/cc-display-panel.ui | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index b361a00a9..6958e1976 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -502,7 +502,7 @@ on_night_light_row_activated_cb (GtkListBoxRow  *row,
 }
 
 static void
-on_primary_display_selected_index_changed_cb (CcDisplayPanel *panel)
+on_primary_display_selected_item_changed_cb (CcDisplayPanel *panel)
 {
   gint idx = adw_combo_row_get_selected (panel->primary_display_row);
   g_autoptr(CcDisplayMonitor) output = NULL;
@@ -604,7 +604,7 @@ cc_display_panel_class_init (CcDisplayPanelClass *klass)
   gtk_widget_class_bind_template_callback (widget_class, on_back_button_clicked_cb);
   gtk_widget_class_bind_template_callback (widget_class, on_config_type_toggled_cb);
   gtk_widget_class_bind_template_callback (widget_class, on_night_light_row_activated_cb);
-  gtk_widget_class_bind_template_callback (widget_class, on_primary_display_selected_index_changed_cb);
+  gtk_widget_class_bind_template_callback (widget_class, on_primary_display_selected_item_changed_cb);
   gtk_widget_class_bind_template_callback (widget_class, on_screen_changed);
   gtk_widget_class_bind_template_callback (widget_class, on_toplevel_escape_pressed_cb);
 }
diff --git a/panels/display/cc-display-panel.ui b/panels/display/cc-display-panel.ui
index 00197bd62..9337b1804 100644
--- a/panels/display/cc-display-panel.ui
+++ b/panels/display/cc-display-panel.ui
@@ -154,7 +154,7 @@
                               <object class="AdwComboRow" id="primary_display_row">
                                 <property name="subtitle" translatable="yes">Contains top bar and 
Activities</property>
                                 <property name="title" translatable="yes">Primary Display</property>
-                                <signal name="notify::selected-index" 
handler="on_primary_display_selected_index_changed_cb" swapped="yes"/>
+                                <signal name="notify::selected-item" 
handler="on_primary_display_selected_item_changed_cb" swapped="yes"/>
                               </object>
                             </child>
                           </object>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]