From 97b823efe6bb92c1584be72181dea91494c1ad4d Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 19 Feb 2024 22:34:24 -0800 Subject: [PATCH] Make ui independent of launch path (#31517) * Make ui independent of launch path * comment old-commit-hash: 5d4dc1dc2ffa5c4066dc33b818e4a2f0497b7043 --- selfdrive/ui/qt/util.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/selfdrive/ui/qt/util.cc b/selfdrive/ui/qt/util.cc index 16d31ce304..bc3c494fa7 100644 --- a/selfdrive/ui/qt/util.cc +++ b/selfdrive/ui/qt/util.cc @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -114,6 +115,11 @@ void initApp(int argc, char *argv[], bool disable_hidpi) { qputenv("QT_DBL_CLICK_DIST", QByteArray::number(150)); + // ensure the current dir matches the exectuable's directory + QApplication tmp(argc, argv); + QString appDir = QCoreApplication::applicationDirPath(); + QDir::setCurrent(appDir); + setQtSurfaceFormat(); }