opentrack: fix desktop icon & window title (#486900)

This commit is contained in:
Adam C. Stephens
2026-02-10 22:35:53 +00:00
committed by GitHub
2 changed files with 22 additions and 1 deletions
@@ -0,0 +1,15 @@
diff --git a/gui/init.cpp b/gui/init.cpp
index 1647b050db0efe76028000939a7ca8e4047116b7..9114c31c51a69294e0803c15008a824e18da7a09 100644
--- a/gui/init.cpp
+++ b/gui/init.cpp
@@ -315,6 +315,10 @@ int otr_main(int argc, char** argv, std::function<std::unique_ptr<QWidget>()> co
add_win32_path();
#endif
+#ifdef Q_OS_LINUX
+ app.setDesktopFileName("opentrack");
+#endif
+
QDir::setCurrent(OPENTRACK_BASE_PATH);
set_qt_style();
+7 -1
View File
@@ -40,6 +40,11 @@ stdenv.mkDerivation (finalAttrs: {
meta.license = lib.licenses.free;
};
patches = [
# calls `app.setDesktopFileName("opentrack");` - distros that don't wrap the binary apparently don't need this.
./desktop-filename.patch
];
strictDeps = true;
nativeBuildInputs = [
@@ -64,13 +69,14 @@ stdenv.mkDerivation (finalAttrs: {
];
cmakeFlags = [
(lib.cmakeFeature "OPENTRACK_COMMIT" "opentrack-${finalAttrs.version}")
(lib.cmakeBool "SDK_WINE" withWine)
(lib.cmakeFeature "SDK_ARUCO_LIBPATH" "${finalAttrs.aruco}/lib/libaruco.a")
(lib.cmakeFeature "SDK_XPLANE" finalAttrs.xplaneSdk.outPath)
];
postInstall = ''
install -Dt $out/share/icons/hicolor/256x256 $src/gui/images/opentrack.png
install -Dt $out/share/icons/hicolor/256x256/apps ../gui/images/opentrack.png
'';
# manually wrap just the main binary