From 4b495e5e7bb19e55a610bba9a15811b4a5d03e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Luc=20Peuri=C3=A8re?= Date: Sun, 1 Aug 2004 22:28:56 +0000 Subject: OS X fix: those who work with visible dock where experimenting slowdown of UI when blender window was overlapping dock. now : - check available space excluding dock - create window with a 10 pixels border - maximised mode is only 1 click away This code is fixing only. Will review that when consensus will be found about how we should create the window. --- intern/ghost/intern/GHOST_SystemCarbon.cpp | 18 ++++++++++-------- intern/ghost/intern/GHOST_WindowCarbon.cpp | 11 ++++++++--- 2 files changed, 18 insertions(+), 11 deletions(-) (limited to 'intern') diff --git a/intern/ghost/intern/GHOST_SystemCarbon.cpp b/intern/ghost/intern/GHOST_SystemCarbon.cpp index 88bc859be6e..e7f087a86bc 100644 --- a/intern/ghost/intern/GHOST_SystemCarbon.cpp +++ b/intern/ghost/intern/GHOST_SystemCarbon.cpp @@ -899,16 +899,18 @@ bool GHOST_SystemCarbon::handleMouseDown(EventRef event) if (macState == 2) { // always ok ::ZoomWindow(window, part, true); ghostWindow->setMac_windowState(1); - } else { // need to force size again - GHOST_TUns32 scr_x,scr_y; + } else { // need to force size again + GHOST_TUns32 scr_x,scr_y; + Rect outAvailableRect; - ghostWindow->setMac_windowState(2); + ghostWindow->setMac_windowState(2); + ::GetAvailableWindowPositioningBounds ( GetMainDevice(), &outAvailableRect); - this->getMainDisplayDimensions(scr_x,scr_y); - ::SizeWindow (window, scr_x,scr_y-22,false); - ::MoveWindow (window, 1,22,true); - } - + //this->getMainDisplayDimensions(scr_x,scr_y); + ::SizeWindow (window, outAvailableRect.right-outAvailableRect.left,outAvailableRect.bottom-outAvailableRect.top-1,false); + ::MoveWindow (window, outAvailableRect.left, outAvailableRect.top,true); + } + } break; diff --git a/intern/ghost/intern/GHOST_WindowCarbon.cpp b/intern/ghost/intern/GHOST_WindowCarbon.cpp index 0c68a571a68..c1d6e8ee49f 100644 --- a/intern/ghost/intern/GHOST_WindowCarbon.cpp +++ b/intern/ghost/intern/GHOST_WindowCarbon.cpp @@ -113,9 +113,11 @@ GHOST_WindowCarbon::GHOST_WindowCarbon( Str255 title255; OSStatus err; + //fprintf(stderr," main screen top %i left %i height %i width %i\n", top, left, height, width); + if (state >= 8 ) { state = state - 8; - setMac_windowState(2); + setMac_windowState(1); } else setMac_windowState(0); @@ -128,10 +130,10 @@ GHOST_WindowCarbon::GHOST_WindowCarbon( kWindowStandardDocumentAttributes+kWindowLiveResizeAttribute, &bnds, &m_windowRef); + if ( err != noErr) { fprintf(stderr," error creating window %i \n",err); } else { - //void *handler = &GHOST_WindowCarbon::myWEventHandlerProc; ::SetWRefCon(m_windowRef,(SInt32)this); setTitle(title); @@ -139,7 +141,10 @@ GHOST_WindowCarbon::GHOST_WindowCarbon( if ( err != noErr) { fprintf(stderr," error creating handler %i \n",err); } else { - ::TransitionWindow (m_windowRef,kWindowZoomTransitionEffect,kWindowShowTransitionAction,NULL); + // ::TransitionWindow (m_windowRef,kWindowZoomTransitionEffect,kWindowShowTransitionAction,NULL); + ::ShowWindow(m_windowRef); + ::MoveWindow (m_windowRef, left, top,true); + } } if (m_windowRef) { -- cgit v1.2.3