From ae74c50d9ab41c4e9c389e50ef1f6c417b50bab9 Mon Sep 17 00:00:00 2001 From: Jens Granseuer Date: Thu, 23 Aug 2007 17:08:43 +0000 Subject: [PATCH] simply set the upper bound of the DPI spin button to the maximum we 2007-08-23 Jens Granseuer * 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 --- capplets/appearance/ChangeLog | 7 +++++++ capplets/appearance/appearance-font.c | 7 +------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/capplets/appearance/ChangeLog b/capplets/appearance/ChangeLog index d552182bb..e248cf738 100644 --- a/capplets/appearance/ChangeLog +++ b/capplets/appearance/ChangeLog @@ -1,3 +1,10 @@ +2007-08-23 Jens Granseuer + + * 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 * appearance-desktop.c: (wp_select_after_realize): if no background diff --git a/capplets/appearance/appearance-font.c b/capplets/appearance/appearance-font.c index e6de0cfda..b76646d8a 100644 --- a/capplets/appearance/appearance-font.c +++ b/capplets/appearance/appearance-font.c @@ -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",