From 9408dddb37026ab59db2409f2ce7b8ee61f14c09 Mon Sep 17 00:00:00 2001 From: Jan Date: Sun, 27 Apr 2025 18:28:55 +0200 Subject: [PATCH] feat: add SDL App Metadata (#2068) * add SDL App Metadata * prefix define with LITE --- meson.build | 5 ++++- src/main.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 7a09d37..05a5c95 100644 --- a/meson.build +++ b/meson.build @@ -43,7 +43,10 @@ conf_data.set('PROJECT_ASSEMBLY_VERSION', meson.project_version() + '.0') cc = meson.get_compiler('c') lite_includes = [] -lite_cargs = ['-DPCRE2_STATIC'] +lite_cargs = [ + '-DPCRE2_STATIC', + '-DLITE_PROJECT_VERSION_STR="@0@"'.format(version) +] # On macos we need to use the SDL renderer to support retina displays if get_option('renderer') or host_machine.system() == 'darwin' lite_cargs += '-DLITE_USE_SDL_RENDERER' diff --git a/src/main.c b/src/main.c index 055dffb..b4db62a 100644 --- a/src/main.c +++ b/src/main.c @@ -120,6 +120,8 @@ int main(int argc, char **argv) { signal(SIGPIPE, SIG_IGN); #endif + SDL_SetAppMetadata("Lite XL", LITE_PROJECT_VERSION_STR, "com.lite_xl.LiteXL"); + if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS)) { fprintf(stderr, "Error initializing SDL: %s", SDL_GetError()); exit(1);