mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-02 09:16:17 +01:00
gapplication: never set the prgname to the app id
GApplication set the prgname to the application's id when it was running in service mode. This broke with the addition of new --app-id option, because g_set_prgname() was called before parsing the options. Calling it after option parsing doesn't work, because GOptionContext sets prgname to argv[0] unconditionally. Instead of changing the semantics of GOptionContext, simply remove this functionality from GApplication. It is very unusual to have the prgname set to the app id instead of the binary's name and might confuse people when looking at logs etc. When overriding local_command_line() from a subclass, g_option_context_parse() might never be invokded. Thus, continue setting the prgname to argv[0] in GApplication. https://bugzilla.gnome.org/show_bug.cgi?id=743933
This commit is contained in:
parent
62f7ea8191
commit
fcb30409ec
@ -2198,11 +2198,7 @@ g_application_open (GApplication *application,
|
||||
* use.
|
||||
*
|
||||
* This function sets the prgname (g_set_prgname()), if not already set,
|
||||
* to the basename of argv[0]. Since 2.38, if %G_APPLICATION_IS_SERVICE
|
||||
* is specified, the prgname is set to the application ID. The main
|
||||
* impact of this is is that the wmclass of windows created by Gtk+ will
|
||||
* be set accordingly, which helps the window manager determine which
|
||||
* application is showing the window.
|
||||
* to the basename of argv[0].
|
||||
*
|
||||
* Since 2.40, applications that are not explicitly flagged as services
|
||||
* or launchers (ie: neither %G_APPLICATION_IS_SERVICE or
|
||||
@ -2250,13 +2246,7 @@ g_application_run (GApplication *application,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g_get_prgname () == NULL)
|
||||
{
|
||||
if (application->priv->flags & G_APPLICATION_IS_SERVICE)
|
||||
{
|
||||
g_set_prgname (application->priv->id);
|
||||
}
|
||||
else if (argc > 0)
|
||||
if (g_get_prgname () == NULL && argc > 0)
|
||||
{
|
||||
gchar *prgname;
|
||||
|
||||
@ -2264,7 +2254,6 @@ g_application_run (GApplication *application,
|
||||
g_set_prgname (prgname);
|
||||
g_free (prgname);
|
||||
}
|
||||
}
|
||||
|
||||
if (!G_APPLICATION_GET_CLASS (application)
|
||||
->local_command_line (application, &arguments, &status))
|
||||
|
Loading…
Reference in New Issue
Block a user