don't crash if we don't have an output (bug #569218)

2009-01-26  Jens Granseuer  <jensgr@gmx.net>

	* xrandr-capplet.c: (rebuild_rate_combo),
	(rebuild_resolution_combo): don't crash if we don't have an output
	(bug #569218)

svn path=/trunk/; revision=9210
This commit is contained in:
Jens Granseuer 2009-01-26 21:37:27 +00:00 committed by Jens Granseuer
parent 70284272a7
commit 7c1b15bed6
2 changed files with 13 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2009-01-26 Jens Granseuer <jensgr@gmx.net>
* xrandr-capplet.c: (rebuild_rate_combo),
(rebuild_resolution_combo): don't crash if we don't have an output
(bug #569218)
2008-12-18 Federico Mena Quintero <federico@novell.com> 2008-12-18 Federico Mena Quintero <federico@novell.com>
* xrandr-capplet.c (get_output_for_window): Include "off" outputs * xrandr-capplet.c (get_output_for_window): Include "off" outputs

View file

@ -373,7 +373,8 @@ rebuild_rate_combo (App *app)
gtk_widget_set_sensitive ( gtk_widget_set_sensitive (
app->refresh_combo, app->current_output && app->current_output->on); app->refresh_combo, app->current_output && app->current_output->on);
if (!(modes = get_current_modes (app))) if (!app->current_output
|| !(modes = get_current_modes (app)))
return; return;
rates = g_hash_table_new_full ( rates = g_hash_table_new_full (
@ -514,6 +515,7 @@ rebuild_resolution_combo (App *app)
clear_combo (app->resolution_combo); clear_combo (app->resolution_combo);
if (!(modes = get_current_modes (app)) if (!(modes = get_current_modes (app))
|| !app->current_output
|| !app->current_output->on) || !app->current_output->on)
{ {
gtk_widget_set_sensitive (app->resolution_combo, FALSE); gtk_widget_set_sensitive (app->resolution_combo, FALSE);