osx: Fixed problem with freezing application while checking behaviour.

Problem was in incorrect application initialization.
[NSApplication sharedApplication] should be call in backend init(not
in init stage). It doesn't require any data and only makes a
connection to window server.
This commit is contained in:
Roman Kudiyarov 2010-07-19 20:46:55 +07:00 committed by Robert Bragg
parent 8c69a639cb
commit 8e2b45648f
2 changed files with 13 additions and 13 deletions

View File

@ -161,6 +161,19 @@ clutter_backend_osx_init (ClutterBackendOSX *backend_osx)
{
backend_osx->context = nil;
backend_osx->pixel_format = nil;
/* Bring our app to foreground, background apps don't appear in dock or
* accept keyboard focus.
*/
const ProcessSerialNumber psn = { 0, kCurrentProcess };
TransformProcessType (&psn, kProcessTransformToForegroundApplication);
/* Also raise our app to front, otherwise our window will remain under the
* terminal.
*/
SetFrontProcess (&psn);
[NSApplication sharedApplication];
}
static void

View File

@ -264,19 +264,6 @@ clutter_stage_osx_realize (ClutterStageWindow *stage_window)
backend_osx = CLUTTER_BACKEND_OSX (self->backend);
/* Bring our app to foreground, background apps don't appear in dock or
* accept keyboard focus.
*/
const ProcessSerialNumber psn = { 0, kCurrentProcess };
TransformProcessType (&psn, kProcessTransformToForegroundApplication);
/* Also raise our app to front, otherwise our window will remain under the
* terminal.
*/
SetFrontProcess (&psn);
[NSApplication sharedApplication];
NSRect rect = NSMakeRect(0, 0, self->requisition_width, self->requisition_height);
self->view = [[ClutterGLView alloc]