application: Validate daemon flag only on first startup
The activate method is used when the application is activated via various means - e.g. via the `Activate` DBus method. We don't want to ignore that activation just because calls was started with the `--daemon` option. Rename the variable to better match what it means. Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/760>
This commit is contained in:
committed by
Evangelos Ribeiro Tzaras
parent
0c3adf840b
commit
fbfe680f6a
@@ -60,7 +60,7 @@
|
|||||||
struct _CallsApplication {
|
struct _CallsApplication {
|
||||||
AdwApplication parent_instance;
|
AdwApplication parent_instance;
|
||||||
|
|
||||||
gboolean daemon;
|
gboolean ignore_activation;
|
||||||
CallsRinger *ringer;
|
CallsRinger *ringer;
|
||||||
CallsNotifier *notifier;
|
CallsNotifier *notifier;
|
||||||
CallsRecordStore *record_store;
|
CallsRecordStore *record_store;
|
||||||
@@ -247,12 +247,9 @@ set_daemon_action (GSimpleAction *action,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
CallsApplication *self = CALLS_APPLICATION (user_data);
|
CallsApplication *self = CALLS_APPLICATION (user_data);
|
||||||
gboolean daemon = g_variant_get_boolean (parameter);
|
|
||||||
|
|
||||||
self->daemon = daemon;
|
self->ignore_activation = g_variant_get_boolean (parameter);
|
||||||
|
g_debug ("Application ignores activation: %d", self->ignore_activation);
|
||||||
g_debug ("Application %smarked as daemon",
|
|
||||||
daemon ? "" : "not ");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -700,14 +697,12 @@ static void
|
|||||||
activate (GApplication *application)
|
activate (GApplication *application)
|
||||||
{
|
{
|
||||||
CallsApplication *self = CALLS_APPLICATION (application);
|
CallsApplication *self = CALLS_APPLICATION (application);
|
||||||
gboolean present;
|
|
||||||
|
|
||||||
g_debug ("Activated");
|
g_debug ("Activated");
|
||||||
|
|
||||||
start_proper (self);
|
start_proper (self);
|
||||||
present = !self->daemon;
|
|
||||||
|
|
||||||
if (present || self->uri) {
|
if (!self->ignore_activation || self->uri) {
|
||||||
gtk_window_present (GTK_WINDOW (self->main_window));
|
gtk_window_present (GTK_WINDOW (self->main_window));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -721,6 +716,7 @@ activate (GApplication *application)
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_clear_pointer (&self->uri, g_free);
|
g_clear_pointer (&self->uri, g_free);
|
||||||
|
self->ignore_activation = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user