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:
parent
70284272a7
commit
7c1b15bed6
2 changed files with 13 additions and 5 deletions
|
@ -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
|
||||||
|
|
|
@ -373,11 +373,12 @@ 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 (
|
||||||
g_str_hash, g_str_equal, (GFreeFunc)g_free, NULL);
|
g_str_hash, g_str_equal, (GFreeFunc) g_free, NULL);
|
||||||
|
|
||||||
best = -1;
|
best = -1;
|
||||||
for (i = 0; modes[i] != NULL; ++i)
|
for (i = 0; modes[i] != NULL; ++i)
|
||||||
|
@ -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);
|
||||||
|
@ -568,7 +570,7 @@ rebuild_gui (App *app)
|
||||||
|
|
||||||
app->ignore_gui_changes = TRUE;
|
app->ignore_gui_changes = TRUE;
|
||||||
|
|
||||||
sensitive = app->current_output? TRUE : FALSE;
|
sensitive = app->current_output ? TRUE : FALSE;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
g_debug ("rebuild gui, is on: %d", app->current_output->on);
|
g_debug ("rebuild gui, is on: %d", app->current_output->on);
|
||||||
|
@ -769,7 +771,7 @@ lay_out_outputs_horizontally (App *app)
|
||||||
|
|
||||||
x += output->width;
|
x += output->width;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1812,7 +1814,7 @@ get_nearest_output (GnomeRRConfig *configuration, int x, int y)
|
||||||
return configuration->outputs[nearest_index];
|
return configuration->outputs[nearest_index];
|
||||||
else
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Gets the output that contains the largest intersection with the window.
|
/* Gets the output that contains the largest intersection with the window.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue