62 lines
2.1 KiB
Diff
62 lines
2.1 KiB
Diff
From 599be8a1b9795b951807e62ff11d033bef6ea666 Mon Sep 17 00:00:00 2001
|
|
From: Ray Strode <rstrode@redhat.com>
|
|
Date: Tue, 23 Jun 2020 14:54:49 -0400
|
|
Subject: [PATCH] timezone: Don't set timezone if tz page is skipped
|
|
|
|
At the moment we still set the timezone from geoclue
|
|
even if the page is supposed to be skipped.
|
|
|
|
This commit defers setting up the geoclue proxy until the
|
|
page is added to the stack.
|
|
|
|
Fixes https://gitlab.gnome.org/GNOME/gnome-initial-setup/-/issues/106
|
|
---
|
|
.../pages/timezone/gis-timezone-page.c | 16 +++++++++++++---
|
|
1 file changed, 13 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/gnome-initial-setup/pages/timezone/gis-timezone-page.c b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
|
|
index ca1088e..9c964c7 100644
|
|
--- a/gnome-initial-setup/pages/timezone/gis-timezone-page.c
|
|
+++ b/gnome-initial-setup/pages/timezone/gis-timezone-page.c
|
|
@@ -387,6 +387,17 @@ stop_geolocation (GisTimezonePage *page)
|
|
g_clear_object (&priv->geoclue_simple);
|
|
}
|
|
|
|
+static void
|
|
+page_added (GisTimezonePage *page)
|
|
+{
|
|
+ GisTimezonePagePrivate *priv = gis_timezone_page_get_instance_private (page);
|
|
+
|
|
+ if (priv->geoclue_cancellable == NULL) {
|
|
+ priv->geoclue_cancellable = g_cancellable_new ();
|
|
+ get_location_from_geoclue_async (page);
|
|
+ }
|
|
+}
|
|
+
|
|
static void
|
|
gis_timezone_page_constructed (GObject *object)
|
|
{
|
|
@@ -418,10 +429,7 @@ gis_timezone_page_constructed (GObject *object)
|
|
priv->clock_format = g_settings_get_enum (settings, CLOCK_FORMAT_KEY);
|
|
g_object_unref (settings);
|
|
|
|
- priv->geoclue_cancellable = g_cancellable_new ();
|
|
-
|
|
set_location (page, NULL);
|
|
- get_location_from_geoclue_async (page);
|
|
|
|
priv->search_entry_text_changed_id =
|
|
g_signal_connect (priv->search_entry, "changed",
|
|
@@ -432,6 +440,8 @@ gis_timezone_page_constructed (GObject *object)
|
|
G_CALLBACK (entry_mapped), page);
|
|
g_signal_connect (priv->map, "location-changed",
|
|
G_CALLBACK (map_location_changed), page);
|
|
+ g_signal_connect (GTK_WIDGET (page), "parent-set",
|
|
+ G_CALLBACK (page_added), NULL);
|
|
|
|
gtk_widget_show (GTK_WIDGET (page));
|
|
}
|
|
--
|
|
2.27.0
|
|
|