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.
This commit is contained in:
Roman Kudiyarov 2010-07-29 21:59:46 +07:00 committed by Robert Bragg
parent dc23b88de2
commit 52b6a3cd49

View File

@ -37,7 +37,19 @@ static gboolean
clutter_backend_osx_post_parse (ClutterBackend *backend, clutter_backend_osx_post_parse (ClutterBackend *backend,
GError **error) 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 static ClutterFeatureFlags