From 1f914d1218125cecdedaf2062c39e8780ce3e72e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Thu, 3 Oct 2019 11:57:53 +0200 Subject: [PATCH] Add version dependent application id. Multiple versions of htis program can now run at the same time --- main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 40d7734..b1a333f 100644 --- a/main.c +++ b/main.c @@ -184,6 +184,7 @@ static void gapp_activate(GApplication *app, gpointer user_data) static int start_gui(int argc, char **argv) { GtkApplication *gapp; + GString *application_domain; int app_status; static struct application_data appdata = { .gui_list = NULL @@ -192,7 +193,16 @@ static int start_gui(int argc, char **argv) GMenu *m_quit; GMenu *m_about; - gapp = gtk_application_new("de.shimatta.gds-render", G_APPLICATION_FLAGS_NONE); + /* + * Generate version dependent application id + * This allows running the application in different versions at the same time. + */ + application_domain = g_string_new(NULL); + g_string_printf(application_domain, "de.shimatta.gds_render_%s", _app_git_commit); + + gapp = gtk_application_new(application_domain->str, G_APPLICATION_FLAGS_NONE); + g_string_free(application_domain, TRUE); + g_application_register(G_APPLICATION(gapp), NULL, NULL); g_signal_connect(gapp, "activate", G_CALLBACK(gapp_activate), &appdata);