]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/window.cpp
SetSizeHints hacks are not needed any longer since the minsize is not
[wxWidgets.git] / src / mac / carbon / window.cpp
index 305886f8907b940a6920ed72478fde045dfd5d78..35913c0d0c2142afbbc5c81d5379bdd9e150a42b 100644 (file)
@@ -918,17 +918,18 @@ bool wxWindowMac::SetBackgroundColour(const wxColour& col )
         return false ;
 
     wxBrush brush ;
-    if ( col == wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) )
+    wxColour newCol(GetBackgroundColour());
+    if ( newCol == wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) )
     {
         brush.MacSetTheme( kThemeBrushDocumentWindowBackground ) ;
     }
-    else if (  col == wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE ) )
+    else if (  newCol == wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE ) )
     {
         brush.MacSetTheme( kThemeBrushDialogBackgroundActive ) ; 
     } 
     else
     {
-        brush.SetColour( col ) ;
+        brush.SetColour( newCol ) ;
     }
     MacSetBackgroundBrush( brush ) ;
         
@@ -1204,7 +1205,11 @@ void wxWindowMac::MacWindowToRootWindow( int *x , int *y ) const
     if ( y ) pt.y = *y ;
 
     if ( !IsTopLevel() )
-        HIViewConvertPoint( &pt , *m_peer , (ControlRef) MacGetTopLevelWindow()->GetHandle()  ) ;
+    {
+        wxTopLevelWindowMac* top = MacGetTopLevelWindow();
+        if (top)
+            HIViewConvertPoint( &pt , *m_peer , (ControlRef) top->GetHandle()  ) ;
+    }
     
     if ( x ) *x = (int) pt.x ;
     if ( y ) *y = (int) pt.y ;