Dont use an env var to force QPA to use xcb

This commit is contained in:
Kovid Goyal 2022-07-14 14:31:58 +05:30
parent 8b91c0e015
commit f46cb54a31
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1065,15 +1065,6 @@ class Application(QApplication):
if set_app_uid(windows_app_uid): if set_app_uid(windows_app_uid):
self.windows_app_uid = windows_app_uid self.windows_app_uid = windows_app_uid
self.file_event_hook = None self.file_event_hook = None
if not iswindows and not ismacos and not os.environ.get('QT_QPA_PLATFORM') and not headless:
# Various issues in Wayland make it unuseable so prevent Qt from
# using Wayland unless the user asks for it explicitly.
# In KDE right clicking on the book list causes left clicks on it
# to stop working till kwin is restarted. On GNOME there are no
# native window decorations. There have been reports of left clicks
# not working in GNOME though I cannot reproduce. So force use of
# XWayland.
os.environ['QT_QPA_PLATFORM'] = 'xcb'
if override_program_name: if override_program_name:
args = [override_program_name] + args[1:] args = [override_program_name] + args[1:]
if headless: if headless:
@ -1088,6 +1079,16 @@ class Application(QApplication):
args.extend(['-platform', 'windows:darkmode=2']) args.extend(['-platform', 'windows:darkmode=2'])
else: else:
args.extend(['-platform', 'windows:darkmode=1']) args.extend(['-platform', 'windows:darkmode=1'])
if not iswindows and not ismacos and not os.environ.get('QT_QPA_PLATFORM'):
# Various issues in Wayland make it unuseable so prevent Qt from
# using Wayland unless the user asks for it explicitly.
# In KDE right clicking on the book list causes left clicks on it
# to stop working till kwin is restarted. On GNOME there are no
# native window decorations. There have been reports of left clicks
# not working in GNOME though I cannot reproduce. So force use of
# XWayland.
args.extend(['-platform', 'xcb'])
self.headless = headless self.headless = headless
from calibre_extensions import progress_indicator from calibre_extensions import progress_indicator
self.pi = progress_indicator self.pi = progress_indicator