diff options
author | Jean-Luc Peurière <jlp@nerim.net> | 2004-08-02 02:28:56 +0400 |
---|---|---|
committer | Jean-Luc Peurière <jlp@nerim.net> | 2004-08-02 02:28:56 +0400 |
commit | 4b495e5e7bb19e55a610bba9a15811b4a5d03e68 (patch) | |
tree | 86d10d40f610b12f01f7c65ff8b1f6305f9e35de /intern | |
parent | c11bb5b7ad73bf7076a51deba1338220aeded5ae (diff) |
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.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCarbon.cpp | 18 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCarbon.cpp | 11 |
2 files changed, 18 insertions, 11 deletions
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) { |