From 0ff0ac9b87b156c62552ec2195584da6f1babde6 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sun, 23 Nov 2003 23:04:35 +0000 Subject: [PATCH] - another hack! well... probably OK, got it from a python mailing list. When starting from commandline, the window doesnt pop to the front. this was really bad for the play function in blender, which opens a new blender thread. solved with SetFrontProcess() --- intern/ghost/Makefile | 2 +- intern/ghost/intern/GHOST_WindowCarbon.cpp | 9 +++++++-- intern/ghost/intern/GHOST_WindowCarbon.h | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/intern/ghost/Makefile b/intern/ghost/Makefile index fe65afbfb93..ccbb223680b 100644 --- a/intern/ghost/Makefile +++ b/intern/ghost/Makefile @@ -41,7 +41,7 @@ TESTDIRS = test include nan_subdirs.mk -install: all debug +install: all @[ -d $(NAN_GHOST) ] || mkdir $(NAN_GHOST) @[ -d $(NAN_GHOST)/include ] || mkdir $(NAN_GHOST)/include @[ -d $(NAN_GHOST)/lib ] || mkdir $(NAN_GHOST)/lib diff --git a/intern/ghost/intern/GHOST_WindowCarbon.cpp b/intern/ghost/intern/GHOST_WindowCarbon.cpp index f8374134d65..29fab93b314 100644 --- a/intern/ghost/intern/GHOST_WindowCarbon.cpp +++ b/intern/ghost/intern/GHOST_WindowCarbon.cpp @@ -42,7 +42,6 @@ #endif #include "GHOST_WindowCarbon.h" - #include "GHOST_Debug.h" AGLContext GHOST_WindowCarbon::s_firstaglCtx = NULL; @@ -108,7 +107,13 @@ GHOST_WindowCarbon::GHOST_WindowCarbon( updateDrawingContext(); activateDrawingContext(); } - if(ugly_hack==NULL) ugly_hack= m_windowRef; + if(ugly_hack==NULL) { + ugly_hack= m_windowRef; + // when started from commandline, window remains in the back... also for play anim + ProcessSerialNumber psn; + GetCurrentProcess(&psn); + SetFrontProcess(&psn); + } } else { /* diff --git a/intern/ghost/intern/GHOST_WindowCarbon.h b/intern/ghost/intern/GHOST_WindowCarbon.h index 1c183028aea..15757556780 100644 --- a/intern/ghost/intern/GHOST_WindowCarbon.h +++ b/intern/ghost/intern/GHOST_WindowCarbon.h @@ -44,6 +44,7 @@ #include "STR_String.h" #include + #include