Remove code that prevents Cura from starting on MAC

The renderer isn't active when the view is activated. As such,
no opengl context *ever* exists. In some cases this might cause it to get
stuck in an indefinate loop.

The comments around it are explaining a situation that can't occur. The activateView
event of SolidView isn't triggered when switching to another view...
This commit is contained in:
Jaime van Kessel 2020-04-20 13:52:40 +02:00
parent 40bc3e247f
commit 9a2d2d32bf
No known key found for this signature in database
GPG key ID: 3710727397403C91

View file

@ -286,25 +286,6 @@ class SolidView(View):
Logger.log("i", "X-Ray overlay found non-manifold pixels.")
def event(self, event):
if event.type == Event.ViewActivateEvent:
# FIX: on Max OS X, somehow QOpenGLContext.currentContext() can become None during View switching.
# This can happen when you do the following steps:
# 1. Start Cura
# 2. Load a model
# 3. Switch to Custom mode
# 4. Select the model and click on the per-object tool icon
# 5. Switch view to Layer view or X-Ray
# 6. Cura will very likely crash
# It seems to be a timing issue that the currentContext can somehow be empty, but I have no clue why.
# This fix tries to reschedule the view changing event call on the Qt thread again if the current OpenGL
# context is None.
if Platform.isOSX():
if QOpenGLContext.currentContext() is None:
Logger.log("d", "current context of OpenGL is empty on Mac OS X, will try to create shaders later")
Application.getInstance().callLater(lambda e = event: self.event(e))
return
if event.type == Event.ViewDeactivateEvent:
if self._composite_pass and 'xray' in self._composite_pass.getLayerBindings():
self.getRenderer().removeRenderPass(self._xray_pass)