From 0e6e3a5d4b51331df8df5bebd60195fbcf5caec5 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 5 Dec 2011 11:42:49 +0000 Subject: [PATCH] backend: Return the correct default resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If ClutterSettings:font-dpi is set to -1 then the default resolution should be returned by ClutterBackend — i.e. 96.0. (cherry picked from commit 943a65b476431400bd0436e1be243a2917385866) Signed-off-by: Emmanuele Bassi --- clutter/clutter-backend.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c index 80e4853..8267544 100644 --- a/clutter/clutter-backend.c +++ b/clutter/clutter-backend.c @@ -179,14 +179,20 @@ clutter_backend_real_resolution_changed (ClutterBackend *backend) ClutterBackendPrivate *priv = backend->priv; ClutterMainContext *context; ClutterSettings *settings; + gdouble resolution; gint dpi; settings = clutter_settings_get_default (); g_object_get (settings, "font-dpi", &dpi, NULL); + if (dpi < 0) + resolution = 96.0; + else + resolution = dpi / 1024.0; + context = _clutter_context_get_default (); if (context->font_map != NULL) - cogl_pango_font_map_set_resolution (context->font_map, dpi / 1024.0); + cogl_pango_font_map_set_resolution (context->font_map, resolution); priv->units_per_em = get_units_per_em (backend, NULL); priv->units_serial += 1; @@ -788,6 +794,9 @@ clutter_backend_get_resolution (ClutterBackend *backend) settings = clutter_settings_get_default (); g_object_get (settings, "font-dpi", &resolution, NULL); + if (resolution < 0) + return 96.0; + return resolution / 1024.0; } -- 1.7.8.1