opentrack: fix desktop icon & window title

Patch fixes `app_id` under Wayland for runtime desktop icon. Previously
`WAYLAND_DEBUG=client opentrack |& grep app_id` would show `""`

New `cmakeFlags` provides `OPENTRACK_COMMIT`, which is usually detected
via `git describe`.
This commit is contained in:
winston
2026-02-04 19:47:06 +01:00
parent 444b409d5e
commit ece36771b6
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