Просмотр исходного кода

Merge pull request #836 from Ultimaker/master-updates-for-Linux

Updating NVidia workaround
Thomas Karl Pietrowski 8 лет назад
Родитель
Сommit
35c520a787
2 измененных файлов с 13 добавлено и 8 удалено
  1. 0 8
      cura/CuraApplication.py
  2. 13 0
      cura_app.py

+ 0 - 8
cura/CuraApplication.py

@@ -58,14 +58,6 @@ import copy
 import urllib
 numpy.seterr(all="ignore")
 
-#WORKAROUND: GITHUB-88 GITHUB-385 GITHUB-612
-if Platform.isLinux(): # Needed for platform.linux_distribution, which is not available on Windows and OSX
-    # For Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/941826
-    if platform.linux_distribution()[0] in ("Ubuntu", ): # TODO: Needs a "if X11_GFX == 'nvidia'" here. The workaround is only needed on Ubuntu+NVidia drivers. Other drivers are not affected, but fine with this fix.
-        import ctypes
-        from ctypes.util import find_library
-        ctypes.CDLL(find_library('GL'), ctypes.RTLD_GLOBAL)
-
 try:
     from cura.CuraVersion import CuraVersion, CuraBuildType
 except ImportError:

+ 13 - 0
cura_app.py

@@ -5,6 +5,19 @@
 
 import os
 import sys
+import platform
+
+from UM.Platform import Platform
+
+#WORKAROUND: GITHUB-88 GITHUB-385 GITHUB-612
+if Platform.isLinux(): # Needed for platform.linux_distribution, which is not available on Windows and OSX
+    # For Ubuntu: https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/941826
+    print(platform.linux_distribution())
+    if platform.linux_distribution()[0] in ("debian", "Ubuntu", ): # TODO: Needs a "if X11_GFX == 'nvidia'" here. The workaround is only needed on Ubuntu+NVidia drivers. Other drivers are not affected, but fine with this fix.
+        import ctypes
+        from ctypes.util import find_library
+        libGL = find_library("GL")
+        ctypes.CDLL(libGL, ctypes.RTLD_GLOBAL)
 
 #WORKAROUND: GITHUB-704 GITHUB-708
 # It looks like setuptools creates a .pth file in