Set QT_MAC_WANTS_LAYER env variable to work in Big Sur

This commit is contained in:
Micah Lee 2020-12-30 10:40:28 -08:00
parent d7e79385d2
commit 78e23a1e8b
No known key found for this signature in database
GPG key ID: 403C2657CD994F73

View file

@ -43,6 +43,10 @@ class Application(QtWidgets.QApplication):
@click.option("--custom-container") # Use this container instead of flmcode/dangerzone
@click.argument("filename", required=False)
def gui_main(custom_container, filename):
# Required for macOS Big Sur: https://stackoverflow.com/a/64878899
if platform.system() == "Darwin":
os.environ["QT_MAC_WANTS_LAYER"] = "1"
# Create the Qt app
app = Application()
app.setQuitOnLastWindowClosed(False)