Commit 49957ef8 authored by Marco Trevisan's avatar Marco Trevisan 🎺

display: Don't always set the primary monitor to the first in list

As per the binding that we have between the list store and the combo-box, when
the first element is added to the list-store, the combo box set this value as
the selected-index, and this leads to a call to cc_display_monitor_set_primary
which set the first-listed monitor as primary and unset the real primary monitor.

To avoid this, just ignore the binding when rebuilding the UI, since in this
phase control-center should just reflect the actual state without changing

Fixes GNOME/gnome-control-center#419
parent cc6e6de8
......@@ -550,7 +550,7 @@ on_primary_display_selected_index_changed_cb (CcDisplayPanel *panel)
gint idx = hdy_combo_row_get_selected_index (panel->primary_display_row);
g_autoptr(CcDisplayMonitor) output = NULL;
if (idx < 0)
if (idx < 0 || panel->rebuilding)
output = g_list_model_get_item (G_LIST_MODEL (panel->primary_display_list), idx);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment