diff --git a/packages/flutter_tools/templates/app_shared/linux.tmpl/my_application.cc.tmpl b/packages/flutter_tools/templates/app_shared/linux.tmpl/my_application.cc.tmpl index f6312e53641..e497462c461 100644 --- a/packages/flutter_tools/templates/app_shared/linux.tmpl/my_application.cc.tmpl +++ b/packages/flutter_tools/templates/app_shared/linux.tmpl/my_application.cc.tmpl @@ -117,6 +117,12 @@ static void my_application_class_init(MyApplicationClass* klass) { static void my_application_init(MyApplication* self) {} MyApplication* my_application_new() { + // Set the program name to the application ID, which helps various systems + // like GTK and desktop environments map this running application to its + // corresponding .desktop file. This ensures better integration by allowing + // the application to be recognized beyond its binary name. + g_set_prgname(APPLICATION_ID); + return MY_APPLICATION(g_object_new(my_application_get_type(), "application-id", APPLICATION_ID, "flags", G_APPLICATION_NON_UNIQUE,