#define GNOME_INTERFACE_SCHEMA "org.gnome.desktop.interface"
-static gdouble pgtk_text_scaling_factor (void)
+static gdouble
+pgtk_get_text_scaling_factor (void)
{
- GSettingsSchemaSource *schema_source = g_settings_schema_source_get_default ();
+ GSettingsSchemaSource *schema_source;
+ GSettingsSchema *schema;
+ GSettings *settings;
+ double factor;
+
+ schema_source = g_settings_schema_source_get_default ();
+
if (schema_source != NULL)
{
- GSettingsSchema *schema = g_settings_schema_source_lookup (schema_source,
- GNOME_INTERFACE_SCHEMA, true);
- if (schema != NULL)
+ schema = g_settings_schema_source_lookup (schema_source,
+ GNOME_INTERFACE_SCHEMA,
+ true);
+
+ if (schema)
{
g_settings_schema_unref (schema);
- GSettings *set = g_settings_new (GNOME_INTERFACE_SCHEMA);
- return g_settings_get_double (set, "text-scaling-factor");
+
+ settings = g_settings_new (GNOME_INTERFACE_SCHEMA);
+ factor = g_settings_get_double (settings,
+ "text-scaling-factor");
+
+ g_object_unref (settings);
+ return factor;
}
}
return 1;
char *dpy_name;
static void *handle = NULL;
Lisp_Object lisp_dpy_name = Qnil;
+ GdkScreen *gscr;
+ gdouble dpi;
block_input ();
reset_mouse_highlight (&dpyinfo->mouse_highlight);
{
- GdkScreen *gscr = gdk_display_get_default_screen (dpyinfo->gdpy);
+ gscr = gdk_display_get_default_screen (dpyinfo->gdpy);
+ dpi = gdk_screen_get_resolution (gscr);
- gdouble dpi = gdk_screen_get_resolution (gscr);
if (dpi < 0)
- dpi = 96.0;
+ dpi = 96.0;
- dpi *= pgtk_text_scaling_factor ();
+ dpi *= pgtk_get_text_scaling_factor ();
dpyinfo->resx = dpi;
dpyinfo->resy = dpi;
}
- /* smooth scroll setting */
- dpyinfo->scroll.x_per_char = 2;
- dpyinfo->scroll.y_per_line = 2;
+ /* Set up scrolling increments. */
+ dpyinfo->scroll.x_per_char = 1;
+ dpyinfo->scroll.y_per_line = 1;
dpyinfo->connection = -1;