Skip to content

Commit 0065d4b

Browse files
committed
Set QT_MAC_WANTS_LAYER='1' on mac to fix issue with the qt backend on mac big sur.
1 parent e6479bd commit 0065d4b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/matplotlib/backends/qt_compat.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ def is_pyqt5():
180180
raise AssertionError("Unexpected QT_API: {}".format(QT_API))
181181

182182

183+
# Fixes issues with Big Sur
184+
# https://bugreports.qt.io/browse/QTBUG-87014, fixed in qt 5.15.2
185+
if (sys.platform == 'darwin' and
186+
LooseVersion(QtCore.qVersion()) < LooseVersion('5.15.2')):
187+
os.environ['QT_MAC_WANTS_LAYER'] = '1'
188+
189+
183190
# These globals are only defined for backcompatibility purposes.
184191
ETS = dict(pyqt=(QT_API_PYQTv2, 4), pyside=(QT_API_PYSIDE, 4),
185192
pyqt5=(QT_API_PYQT5, 5), pyside2=(QT_API_PYSIDE2, 5))

0 commit comments

Comments
 (0)