mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-03 16:03:40 +02:00
GApplication: Add a way to replace a unique instance
While uniqueness is great, sometimes you want to restart a newer version of the same app. These two flags make that possible. We also add a ::name-lost signal, that is emitted when it happens. The default handler for this signal just calls g_application_quit(), but applications may want to connect and do cleanup or state-saving here.
This commit is contained in:
@@ -1474,6 +1474,11 @@ typedef enum
|
||||
* @G_APPLICATION_CAN_OVERRIDE_APP_ID: Allow users to override the
|
||||
* application ID from the command line with `--gapplication-app-id`.
|
||||
* Since: 2.48
|
||||
* @G_APPLICATION_ALLOW_REPLACEMENT: Allow another instance to take over
|
||||
* the bus name. Since: 2.60
|
||||
* @G_APPLICATION_REPLACE: Take over from another instance. This flag is
|
||||
* usually set by passing `--gapplication-replace` on the commandline.
|
||||
* Since: 2.60
|
||||
*
|
||||
* Flags used to define the behaviour of a #GApplication.
|
||||
*
|
||||
@@ -1491,7 +1496,9 @@ typedef enum
|
||||
|
||||
G_APPLICATION_NON_UNIQUE = (1 << 5),
|
||||
|
||||
G_APPLICATION_CAN_OVERRIDE_APP_ID = (1 << 6)
|
||||
G_APPLICATION_CAN_OVERRIDE_APP_ID = (1 << 6),
|
||||
G_APPLICATION_ALLOW_REPLACEMENT = (1 << 7),
|
||||
G_APPLICATION_REPLACE = (1 << 8)
|
||||
} GApplicationFlags;
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user