From 9a2d2d32bfc8524e8229ea7561b4499c482bfcd9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 20 Apr 2020 13:52:40 +0200 Subject: [PATCH] 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... --- plugins/SolidView/SolidView.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/plugins/SolidView/SolidView.py b/plugins/SolidView/SolidView.py index 8c9967be03..bd8215aba5 100644 --- a/plugins/SolidView/SolidView.py +++ b/plugins/SolidView/SolidView.py @@ -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)