From cade611712c355467b2d7b51e2662ca3662608c8 Mon Sep 17 00:00:00 2001 From: Dennis Weil <35080133+dennisweil@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:47:19 +0200 Subject: [PATCH] fix: Backlog/move pyside2 specific flag (#581) --- apps/connect/release_notes.md | 1 + .../connect/source/ftrack_connect/__main__.py | 25 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/connect/release_notes.md b/apps/connect/release_notes.md index 6763090ed..8abb3c1d7 100644 --- a/apps/connect/release_notes.md +++ b/apps/connect/release_notes.md @@ -2,6 +2,7 @@ ## Upcoming +* [changed] Move deprecated HighDPI settings into PySide2 specific codepath. * [fix] Fix ctrl+c interrupt behaviour when launching connect through the commandline. It will now properly exit the application. * [fix] Remove obsolete pkg_resources import which lead to errors when launching through the commandline diff --git a/apps/connect/source/ftrack_connect/__main__.py b/apps/connect/source/ftrack_connect/__main__.py index e5bfa8d1b..af28a3a54 100644 --- a/apps/connect/source/ftrack_connect/__main__.py +++ b/apps/connect/source/ftrack_connect/__main__.py @@ -113,21 +113,20 @@ def main_connect(arguments=None): ) raise SystemExit(1) - # If under X11, make Xlib calls thread-safe. - # http://stackoverflow.com/questions/31952711/threading-pyqt-crashes-with-unknown-request-in-queue-while-dequeuing - - if os.name == 'posix' and is_pyside2: + if is_pyside2: + # These HighDPI settings are deprecated and enabled by default in PySide6. QtCore.QCoreApplication.setAttribute( - QtCore.Qt.ApplicationAttribute.AA_X11InitThreads + QtCore.Qt.AA_EnableHighDpiScaling, True ) - - # Ensure support for highdpi - QtCore.QCoreApplication.setAttribute( - QtCore.Qt.AA_EnableHighDpiScaling, True - ) - QtCore.QCoreApplication.setAttribute( - QtCore.Qt.ApplicationAttribute.AA_UseHighDpiPixmaps, True - ) + QtCore.QCoreApplication.setAttribute( + QtCore.Qt.ApplicationAttribute.AA_UseHighDpiPixmaps, True + ) + # If under X11, make Xlib calls thread-safe. + # http://stackoverflow.com/questions/31952711/threading-pyqt-crashes-with-unknown-request-in-queue-while-dequeuing + if os.name == 'posix': + QtCore.QCoreApplication.setAttribute( + QtCore.Qt.ApplicationAttribute.AA_X11InitThreads + ) # Construct global application.