From 52b6a3cd49c4fd654bde0a03b8e57156e731076f Mon Sep 17 00:00:00 2001 From: Roman Kudiyarov Date: Thu, 29 Jul 2010 21:59:46 +0700 Subject: [PATCH] osx: added resolution initialization in backend It's important step of initialization because all features calls from font rendering libs based on this parameter. By default it equals to -1 and test-text-cache test crashes in this case. --- clutter/osx/clutter-backend-osx.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/clutter/osx/clutter-backend-osx.c b/clutter/osx/clutter-backend-osx.c index a90460d23..c3e0f40b0 100644 --- a/clutter/osx/clutter-backend-osx.c +++ b/clutter/osx/clutter-backend-osx.c @@ -37,7 +37,19 @@ static gboolean clutter_backend_osx_post_parse (ClutterBackend *backend, GError **error) { - return TRUE; + CLUTTER_OSX_POOL_ALLOC(); + /* getting standart dpi for main screen */ + NSDictionary* prop = [[NSScreen mainScreen] deviceDescription]; + NSSize size; + [[prop valueForKey:@"NSDeviceResolution"] getValue:&size]; + CLUTTER_OSX_POOL_RELEASE(); + /* setting dpi for backend, it needs by font rendering library */ + if (size.height > 0) + { + clutter_backend_set_resolution (backend, size.height); + return TRUE; + } + return FALSE; } static ClutterFeatureFlags