X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/564a150b1f7c63a060c1b205a7cd50035031cd4b..a45beea1e36b9655c47c5f744c5d8212f871b0c1:/src/mac/carbon/glcanvas.cpp diff --git a/src/mac/carbon/glcanvas.cpp b/src/mac/carbon/glcanvas.cpp index e208531ff4..facd34a510 100644 --- a/src/mac/carbon/glcanvas.cpp +++ b/src/mac/carbon/glcanvas.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: glcanvas.cpp -// Purpose: wxGLCanvas, for using OpenGL with wxWindows under Macintosh +// Purpose: wxGLCanvas, for using OpenGL with wxWidgets under Macintosh // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 @@ -49,7 +49,7 @@ wxGLContext::wxGLContext( { m_window = win; - m_drawable = (AGLDrawable) UMAGetWindowPort(MAC_WXHWND(win->MacGetRootWindow())); + m_drawable = (AGLDrawable) UMAGetWindowPort(MAC_WXHWND(win->MacGetTopLevelWindowRef())); m_glContext = aglCreateContext(fmt, other ? other->m_glContext : NULL); wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") ); @@ -262,7 +262,7 @@ void wxGLCanvas::SetViewport() int width, height; GetClientSize(& width, & height); Rect bounds ; - GetWindowPortBounds( MAC_WXHWND(MacGetRootWindow()) , &bounds ) ; + GetWindowPortBounds( MAC_WXHWND(MacGetTopLevelWindowRef()) , &bounds ) ; GLint parms[4] ; parms[0] = x ; parms[1] = bounds.bottom - bounds.top - ( y + height ) ; @@ -320,7 +320,7 @@ bool wxGLCanvas::Show(bool show) { if ( !wxWindow::Show( show ) ) return FALSE ; - +/* if ( !show ) { if ( m_macCanvasIsShown ) @@ -331,18 +331,19 @@ bool wxGLCanvas::Show(bool show) } else { - if ( MacIsReallyShown() && !m_macCanvasIsShown ) + if ( m_peer->IsVisible()&& !m_macCanvasIsShown ) { m_macCanvasIsShown = true ; SetViewport() ; } } +*/ return TRUE ; } -void wxGLCanvas::MacSuperShown( bool show ) +void wxGLCanvas::MacVisibilityChanged() { - if ( !show ) + if ( !MacIsReallyShown() ) { if ( m_macCanvasIsShown ) { @@ -352,14 +353,13 @@ void wxGLCanvas::MacSuperShown( bool show ) } else { - if ( MacIsReallyShown() && !m_macCanvasIsShown ) + if ( !m_macCanvasIsShown ) { m_macCanvasIsShown = true ; SetViewport() ; } } - - wxWindow::MacSuperShown( show ) ; + wxWindowMac::MacVisibilityChanged() ; } //---------------------------------------------------------------------------