Merge branch 'gl-workaround'

This commit is contained in:
Florian Bruhin 2017-03-15 19:52:33 +01:00
commit 85fff35eef
2 changed files with 20 additions and 1 deletions

View File

@ -28,6 +28,12 @@ Changed
- When using QtWebEngine, the underlying Chromium version is now shown in the - When using QtWebEngine, the underlying Chromium version is now shown in the
version info. version info.
Fixed
~~~~~
- Added a workaround for a black screen with QtWebEngine with some setups
(requires PyOpenGL to be installed)
v0.10.1 v0.10.1
------- -------

View File

@ -25,6 +25,7 @@ Module attributes:
""" """
import os import os
import logging
# pylint: disable=no-name-in-module,import-error,useless-suppression # pylint: disable=no-name-in-module,import-error,useless-suppression
from PyQt5.QtWebEngineWidgets import (QWebEngineSettings, QWebEngineProfile, from PyQt5.QtWebEngineWidgets import (QWebEngineSettings, QWebEngineProfile,
@ -33,7 +34,7 @@ from PyQt5.QtWebEngineWidgets import (QWebEngineSettings, QWebEngineProfile,
from qutebrowser.browser import shared from qutebrowser.browser import shared
from qutebrowser.config import config, websettings from qutebrowser.config import config, websettings
from qutebrowser.utils import objreg, utils, standarddir, javascript from qutebrowser.utils import objreg, utils, standarddir, javascript, log
class Attribute(websettings.Attribute): class Attribute(websettings.Attribute):
@ -159,6 +160,18 @@ def init(args):
if args.enable_webengine_inspector: if args.enable_webengine_inspector:
os.environ['QTWEBENGINE_REMOTE_DEBUGGING'] = str(utils.random_port()) os.environ['QTWEBENGINE_REMOTE_DEBUGGING'] = str(utils.random_port())
# Workaround for a black screen with some setups
# https://github.com/spyder-ide/spyder/issues/3226
if not os.environ.get('QUTE_NO_OPENGL_WORKAROUND'):
# Hide "No OpenGL_accelerate module loaded: ..." message
logging.getLogger('OpenGL.acceleratesupport').propagate = False
try:
from OpenGL import GL
except ImportError:
pass
else:
log.misc.debug("Imported PyOpenGL as workaround")
profile = QWebEngineProfile.defaultProfile() profile = QWebEngineProfile.defaultProfile()
_init_profile(profile) _init_profile(profile)
_init_stylesheet(profile) _init_stylesheet(profile)