From ea6b78e870330dbb91475708ae6e61bb7bede217 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 7 Jan 2009 23:28:46 +0000 Subject: [PATCH] Desensitize the Resolution combo when the output is off Signed-off-by: Federico Mena Quintero svn path=/trunk/; revision=9189 --- capplets/display/ChangeLog | 2 ++ capplets/display/xrandr-capplet.c | 22 +++++++--------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/capplets/display/ChangeLog b/capplets/display/ChangeLog index 3b9fad9e9..20076e67b 100644 --- a/capplets/display/ChangeLog +++ b/capplets/display/ChangeLog @@ -21,6 +21,8 @@ buttons based on the "on" state of the current output. (monitor_on_off_toggled_cb): New callback; we toggle the current output's on/off state. + (rebuild_resolution_combo): Desensitize the resolution combo when + the output is off. Don't add an "Off" item to it, either. 2008-12-18 Federico Mena Quintero diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c index 6fe28dd0c..0505d654b 100644 --- a/capplets/display/xrandr-capplet.c +++ b/capplets/display/xrandr-capplet.c @@ -513,12 +513,15 @@ rebuild_resolution_combo (App *app) clear_combo (app->resolution_combo); - if (!(modes = get_current_modes (app))) + if (!(modes = get_current_modes (app)) + || !app->current_output->on) { gtk_widget_set_sensitive (app->resolution_combo, FALSE); return; } + g_assert (app->current_output != NULL); + gtk_widget_set_sensitive (app->resolution_combo, TRUE); best_w = 0; @@ -541,20 +544,9 @@ rebuild_resolution_combo (App *app) } } - if (count_active_outputs (app) > 1 || !app->current_output->on) - add_key (app->resolution_combo, _("Off"), 0, 0, 0, 0); - - if (!app->current_output->on) - { - current = "Off"; - } - else - { - current = idle_free (g_strdup_printf (_("%d x %d"), - app->current_output->width, - app->current_output->height)); - } - + current = idle_free (g_strdup_printf (_("%d x %d"), + app->current_output->width, + app->current_output->height)); if (!combo_select (app->resolution_combo, current)) {