Skip to content

Commit

Permalink
Fixed some "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. Additionally, although this fixes the initial "invalid drawable" messages on startup, they still appear later on when switching between fullscreen and not-fullscreen. This goes some way to addressing GafferHQ#396, but I suspect it'll be very hard to fix it completely without patching Qt in some way.
  • Loading branch information
johnhaddon committed Jan 28, 2014
1 parent a9e2596 commit c2eafc0
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.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 c2eafc0

Please sign in to comment.