From 4d156ec19511ee10f8659b4f089891bbd67bd59a Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 25 Oct 2003 13:25:59 +0000 Subject: - found the bad line in Ghost that preventing closing windows. I've mailed Maarten to verify it, this commit is for test at other OSX platforms. - this was the baddie: setDrawingContextType(GHOST_kDrawingContextTypeNone); it was called in the window destructor, for each window closed. I've hacked in a temporal global var to store the mainwindow. When this line is only called for mainwindow, it all works smoothly. - next commit is needed too! --- intern/ghost/intern/GHOST_WindowCarbon.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'intern') diff --git a/intern/ghost/intern/GHOST_WindowCarbon.cpp b/intern/ghost/intern/GHOST_WindowCarbon.cpp index 35e1efc793e..f8374134d65 100644 --- a/intern/ghost/intern/GHOST_WindowCarbon.cpp +++ b/intern/ghost/intern/GHOST_WindowCarbon.cpp @@ -67,6 +67,8 @@ AGL_DEPTH_SIZE, 16, AGL_NONE, }; +WindowRef ugly_hack=NULL; + GHOST_WindowCarbon::GHOST_WindowCarbon( const STR_String& title, GHOST_TInt32 left, @@ -106,6 +108,7 @@ GHOST_WindowCarbon::GHOST_WindowCarbon( updateDrawingContext(); activateDrawingContext(); } + if(ugly_hack==NULL) ugly_hack= m_windowRef; } else { /* @@ -133,8 +136,10 @@ GHOST_WindowCarbon::~GHOST_WindowCarbon() { if (m_customCursor) delete m_customCursor; - //GHOST_PRINT("GHOST_WindowCarbon::~GHOST_WindowCarbon(): removing drawing context\n"); - setDrawingContextType(GHOST_kDrawingContextTypeNone); + if(ugly_hack==m_windowRef) ugly_hack= NULL; + + // printf("GHOST_WindowCarbon::~GHOST_WindowCarbon(): removing drawing context\n"); + if(ugly_hack==NULL) setDrawingContextType(GHOST_kDrawingContextTypeNone); if (m_windowRef) { ::DisposeWindow(m_windowRef); m_windowRef = 0; @@ -333,6 +338,7 @@ GHOST_TSuccess GHOST_WindowCarbon::setOrder(GHOST_TWindowOrder order) ::SelectWindow(m_windowRef); } else { + /* doesnt work if you do this with a mouseclick */ ::SendBehind(m_windowRef, nil); } return GHOST_kSuccess; -- cgit v1.2.3