]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/tooltip.cpp
removing unnecessary invalidation in Update, adding a forced update to ScrollWindow...
[wxWidgets.git] / src / mac / carbon / tooltip.cpp
index f269196711157a8e22ccda5890817a5221162d72..acd76b39a0b52492aee1289ea3a28668e9a00997 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Robert Roebling
 // Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
-// Licence:     wxWindows licence
+// Licence:     wxWidgets licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -154,7 +154,7 @@ void wxToolTip::RelayEvent( wxWindow *win , wxMouseEvent &event )
                 s_ToolTipArea = wxRect2DInt( event.m_x - 2 , event.m_y - 2 , 4 , 4 ) ;
                 s_LastWindowEntered = win ;
                 
-                WindowRef window = MAC_WXHWND( win->MacGetRootWindow() ) ;
+                WindowRef window = MAC_WXHWND( win->MacGetTopLevelWindowRef() ) ;
                 int x = event.m_x ;
                 int y = event.m_y ;
                 wxPoint local( x , y ) ;
@@ -228,11 +228,11 @@ void wxMacToolTip::Draw()
         tag.version = kMacHelpVersion;
         SetRect( &tag.absHotRect , m_position.x - 2 , m_position.y - 2 , m_position.x + 2 , m_position.y + 2 ) ;
         GrafPtr port ;
-        GetPort( &port ) ;
-        SetPortWindowPort(m_window) ;
+        bool swapped = QDSwapPort( GetWindowPort( m_window ) , &port ) ;
         LocalToGlobal( (Point *) &tag.absHotRect.top );
         LocalToGlobal( (Point *) &tag.absHotRect.bottom );
-        SetPort( port );
+        if ( swapped )
+            SetPort( port );
         m_helpTextRef.Assign( m_label  , wxFONTENCODING_DEFAULT ) ;
         tag.content[kHMMinimumContentIndex].contentType = kHMCFStringContent ;
         tag.content[kHMMinimumContentIndex].u.tagCFString = m_helpTextRef ;