Skip to content

Commit

Permalink
Fixed "invalid drawable" error messages on OS X.
Browse files Browse the repository at this point in the history
I had hoped that this fix would make the previous commit unnecessary, but testing shows that they address different problems and both are needed.

Fixes GafferHQ#396.
  • Loading branch information
johnhaddon committed Jan 22, 2014
1 parent 55c99bf commit 144e93a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion python/GafferUI/GLWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,26 @@ def __init__( self, format ) :
self.setVerticalScrollBarPolicy( QtCore.Qt.ScrollBarAlwaysOff )

glWidget = self.__createQGLWidget( format )


# On mac, we need to hide the GL widget until the last
# possible moment, otherwise we get "invalid drawable"
# errors spewing all over the place. See event() for the
# spot where we show the widget.
glWidget.hide()

self.setViewport( glWidget )
self.setViewportUpdateMode( self.FullViewportUpdate )

def event( self, event ) :

if event.type() == event.Type.PolishRequest :
# This seems to be the one signal that reliably
# lets us know we're becoming genuinely visible
# on screen. We use it to show the GL widget we
# hid in our constructor.
self.viewport().show()

return QtGui.QGraphicsView.event( self, event )

def resizeEvent( self, event ) :

Expand Down

0 comments on commit 144e93a

Please sign in to comment.