summaryrefslogtreecommitdiff
path: root/panels
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2019-03-20 15:10:21 +0100
committerBenjamin Berg <bberg@redhat.com>2019-03-20 18:01:01 +0100
commitb2f1d489ad277b5158ff40d0ff2dab368058aced (patch)
treecbeafb565959f2ef74f342b61efb6e8517ac581b /panels
parente387b3bb8610307ec4e814897d30ae7a44ae44d4 (diff)
downloadgnome-control-center-b2f1d489ad277b5158ff40d0ff2dab368058aced.tar.gz
display: Add unusable monitors to dropdown and disable switch for them
We should show unusable monitors in the monitor selection drop-down list. So always add them to the combobox and add the code to make the switch to enable them insensitive.
Diffstat (limited to 'panels')
-rw-r--r--panels/display/cc-display-panel.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 03d697a0c..b95a6deea 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -664,11 +664,13 @@ set_current_output (CcDisplayPanel *panel,
{
gtk_label_set_text (panel->current_output_label, cc_display_monitor_get_ui_name (panel->current_output));
gtk_switch_set_active (panel->output_enabled_switch, cc_display_monitor_is_active (panel->current_output));
+ gtk_widget_set_sensitive (GTK_WIDGET (panel->output_enabled_switch), cc_display_monitor_is_usable (panel->current_output));
}
else
{
gtk_label_set_text (panel->current_output_label, "");
gtk_switch_set_active (panel->output_enabled_switch, FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (panel->output_enabled_switch), FALSE);
}
if (g_object_get_data (G_OBJECT (panel->output_selection_two_first), "display") == output)
@@ -722,6 +724,13 @@ rebuild_ui (CcDisplayPanel *panel)
GtkTreeIter iter;
CcDisplayMonitor *output = l->data;
+ gtk_list_store_append (panel->output_selection_list, &iter);
+ gtk_list_store_set (panel->output_selection_list,
+ &iter,
+ 0, cc_display_monitor_get_ui_number_name (output),
+ 1, output,
+ -1);
+
if (!cc_display_monitor_is_usable (output))
continue;
@@ -744,13 +753,6 @@ rebuild_ui (CcDisplayPanel *panel)
output);
}
- gtk_list_store_append (panel->output_selection_list, &iter);
- gtk_list_store_set (panel->output_selection_list,
- &iter,
- 0, cc_display_monitor_get_ui_number_name (output),
- 1, output,
- -1);
-
if (cc_display_monitor_is_active (output))
{
n_active_outputs += 1;