main.c: set "register-session" property for gtk_application
authorFriedrich Beckmann <friedrich.beckmann@gmx.de>
Sat, 20 Jun 2020 13:48:57 +0000 (15:48 +0200)
committerFriedrich Beckmann <friedrich.beckmann@gmx.de>
Sat, 20 Jun 2020 16:55:52 +0000 (18:55 +0200)
To open an application by clicking an associated file like
grid.sps in the Finder on Macos requires that the property
"register-session" is set for gtk_application. I did not
find a negative impact on Debian bullseye so I hope this
works also on other platforms. The gtk support for this
will be in the next gtk-3-24 release.

See: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2098

src/ui/gui/main.c

index f1b525f31c92d5467a4c26478f306a2b397c4212..dee766cbffb735622c24bb5f3e1e1a88ec336679 100644 (file)
@@ -401,5 +401,6 @@ main (int argc, char *argv[])
     g_action_map_add_action (G_ACTION_MAP (app), G_ACTION (act_new_data));
   }
 
+  g_object_set (G_OBJECT (app), "register-session", TRUE, NULL);
   return g_application_run (G_APPLICATION (app), argc, argv);
 }