Browse Source

weird ctypes thing.. ?

ubuntu-nvidia-bug
forest 3 years ago
parent
commit
7045da3c7c
  1. 19
      src/main/python/main.py

19
src/main/python/main.py

@ -1,3 +1,22 @@
# https://github.com/mherrmann/fbs/issues/185#issuecomment-633243118
if distro.like() == 'ubuntu':
print('Importing ctypes')
# This import is needed to fix errors with Nvidia Drivers on Ubuntu/Debian QtWebEngine: can load wrong libGL.s
# See issue https://github.com/spyder-ide/spyder/issues/3226
try:
# from OpenGL import GL
import ctypes
from ctypes import util
ctypes.CDLL(ctypes.util.find_library("GL"), mode=ctypes.RTLD_GLOBAL)
ctypes.CDLL(ctypes.util.find_library("gcc_s"), mode=ctypes.RTLD_GLOBAL)
# fixes libz by loading the one from src/main/resources/ubuntu/libz.so.1
ctypes.CDLL('libz.so.1', ctypes.RTLD_GLOBAL)
print('Imported ctypes successfully')
except:
print('ctypes NOT imported')
pass
from fbs_runtime.application_context.PyQt5 import ApplicationContext
from PyQt5.QtCore import Qt, QThreadPool, QRect
from PyQt5.QtGui import QPixmap, QColor, QIcon, QPalette, QFont

Loading…
Cancel
Save