Files
paparazzi/paparazzi
T
Gautier Hattenberger 4f16ae0d56
Issues due date / Add labels to issues (push) Has been cancelled
Doxygen / build (push) Has been cancelled
[wayland] only use Qt/wayland if available (#3545)
After #3528 and #3525, only try to use wayland if it is available.
This is preventing a lot of warnings if the fallback option is used.
2025-10-03 15:10:44 +02:00

25 lines
794 B
Python
Executable File

#!/usr/bin/env python3
import os
import sys
# Make sure to use Wayland for high DPI screens
if os.environ["XDG_SESSION_TYPE"] == "wayland":
os.environ["QT_QPA_PLATFORM"] = "wayland;xcb"
dirname = os.path.dirname(os.path.abspath(__file__))
PAPARAZZI_HOME = os.getenv("PAPARAZZI_HOME",dirname)
PAPARAZZI_SRC = os.getenv("PAPARAZZI_SRC",PAPARAZZI_HOME)
env = os.environ
env['PAPARAZZI_HOME'] = PAPARAZZI_HOME
env['PAPARAZZI_SRC'] = PAPARAZZI_SRC
if len(sys.argv) > 1 and sys.argv[1] == "-legacy":
del sys.argv[1]
path = os.path.normpath(os.path.join(dirname, 'sw', 'supervision', 'paparazzicenter'))
os.execve(path, sys.argv, env)
else:
path = os.path.normpath(os.path.join(dirname, 'sw', 'supervision', 'python', 'paparazzicenter.py'))
os.execve(path, sys.argv, env)