simply set the upper bound of the DPI spin button to the maximum we

2007-08-23  Jens Granseuer  <jensgr@gmx.net>

	* appearance-font.c: (cb_show_details): simply set the upper bound of
	the DPI spin button to the maximum we consider reasonable. This is one
	way to make sure we don't get SIGFPE if for some reason
	gdk_screen_get_{width,height}_mm returns 0 (bug #469580)

svn path=/trunk/; revision=8039
This commit is contained in:
Jens Granseuer 2007-08-23 17:08:43 +00:00 committed by Jens Granseuer
parent 92a43a9ee5
commit ae74c50d9a
2 changed files with 8 additions and 6 deletions

View file

@ -1,3 +1,10 @@
2007-08-23 Jens Granseuer <jensgr@gmx.net>
* appearance-font.c: (cb_show_details): simply set the upper bound of
the DPI spin button to the maximum we consider reasonable. This is one
way to make sure we don't get SIGFPE if for some reason
gdk_screen_get_{width,height}_mm returns 0 (bug #469580)
2007-08-22 Jens Granseuer <jensgr@gmx.net>
* appearance-desktop.c: (wp_select_after_realize): if no background

View file

@ -805,7 +805,6 @@ cb_show_details (GtkWidget *button,
{
if (!data->font_details) {
GnomeVFSURI *uri;
gint dpi;
GtkAdjustment *adjustment;
GtkWidget *widget;
@ -825,12 +824,8 @@ cb_show_details (GtkWidget *button,
widget = glade_xml_get_widget (data->xml, "dpi_spinner");
/* pick a sensible maximum dpi */
dpi = floor ((gdk_screen_width () / gdk_screen_width_mm () +
gdk_screen_height () / gdk_screen_height_mm ()) * 25.4 / 2. + .5);
if (dpi < DPI_LOW_REASONABLE_VALUE)
dpi = DPI_LOW_REASONABLE_VALUE; /* be extra careful */
adjustment = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (widget));
adjustment->upper = dpi * 3;
adjustment->upper = DPI_HIGH_REASONABLE_VALUE;
dpi_load (data->client, GTK_SPIN_BUTTON (widget));
g_signal_connect (widget, "value_changed",