display: make the Apply button unsensitive for invalid configuration

If the configuration is not applicable, due to HW constraints we
know about, make the button insensitive, to avoid an error dialog
later on.

https://bugzilla.gnome.org/show_bug.cgi?id=727023
This commit is contained in:
Giovanni Campagna 2014-03-25 18:03:43 +01:00 committed by Debarshi Ray
parent 3350111679
commit 64b3fdc2fc

View file

@ -1114,6 +1114,13 @@ update_apply_button (CcDisplayPanel *panel)
gboolean config_equal;
GnomeRRConfig *current_configuration;
if (!gnome_rr_config_applicable (priv->current_configuration,
priv->screen, NULL))
{
gtk_widget_set_sensitive (priv->apply_button, FALSE);
return;
}
current_configuration = gnome_rr_config_new_current (priv->screen, NULL);
/* this checks if the same modes will be set on the outputs */