gapplication: add a way to override the app-id

Some applications support running in a mode where they present
themselves as a different application to the user (for example web
browsers or terminals).

To facilitate this, add an option --gapplication-app-id which allows
users to override an application's id from desktop files or similar.

Applications need to opt-in to this by setting the
G_APPLICATION_CAN_OVERRIDE_APP_ID flag.

https://bugzilla.gnome.org/show_bug.cgi?id=743933
This commit is contained in:
Lars Uebernickel
2015-02-03 14:09:44 +01:00
committed by Matthias Clasen
parent 15dea440c4
commit b32f8ba19b
2 changed files with 31 additions and 8 deletions

View File

@@ -1464,6 +1464,9 @@ typedef enum
* owner of the application ID nor does it check if an existing
* owner already exists. Everything occurs in the local process.
* Since: 2.30.
* @G_APPLICATION_CAN_OVERRIDE_APP_ID: Allow users to override the
* application ID from the command line with `--gapplication-app-id`.
* Since: 2.48
*
* Flags used to define the behaviour of a #GApplication.
*
@@ -1479,7 +1482,9 @@ typedef enum
G_APPLICATION_HANDLES_COMMAND_LINE = (1 << 3),
G_APPLICATION_SEND_ENVIRONMENT = (1 << 4),
G_APPLICATION_NON_UNIQUE = (1 << 5)
G_APPLICATION_NON_UNIQUE = (1 << 5),
G_APPLICATION_CAN_OVERRIDE_APP_ID = (1 << 6)
} GApplicationFlags;
/**