1
Index: gnome-panel-3.3.5/applets/clock/clock.c
2
===================================================================
3
--- gnome-panel-3.3.5.orig/applets/clock/clock.c 2012-02-02 11:51:27.000000000 -0500
4
+++ gnome-panel-3.3.5/applets/clock/clock.c 2012-02-07 22:57:41.193548904 -0500
6
#include "clock-location-tile.h"
8
#include "clock-utils.h"
9
+#include "set-timezone.h"
10
#include "system-timezone.h"
12
#define INTERNETSECOND (864)
13
Index: gnome-panel-3.3.5/applets/clock/set-timezone.c
14
===================================================================
15
--- gnome-panel-3.3.5.orig/applets/clock/set-timezone.c 2012-02-02 11:51:54.000000000 -0500
16
+++ gnome-panel-3.3.5/applets/clock/set-timezone.c 2012-02-07 22:58:04.109662547 -0500
21
-#include <polkit/polkit.h>
27
+#include <sys/wait.h>
29
#include "set-timezone.h"
31
#define CACHE_VALIDITY_SEC 20
33
-#define MECHANISM_BUS_NAME "org.freedesktop.timedate1"
34
-#define MECHANISM_OBJECT_PATH "/org/freedesktop/timedate1"
35
-#define MECHANISM_INTERFACE "org.freedesktop.timedate1"
36
+#define MECHANISM_BUS_NAME "org.gnome.SettingsDaemon.DateTimeMechanism"
37
+#define MECHANISM_OBJECT_PATH "/"
38
+#define MECHANISM_INTERFACE "org.gnome.SettingsDaemon.DateTimeMechanism"
41
+ gboolean in_progress;
50
+can_set_call_finished (GObject *source,
51
+ GAsyncResult *result,
54
+ Cache *cache = user_data;
57
+ reply = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source),
62
+ g_variant_get (reply, "(i)", &cache->value);
63
+ g_variant_unref (reply);
66
+ cache->stamp = g_get_monotonic_time ();
67
+ cache->in_progress = FALSE;
71
can_set (Cache *cache, const gchar *method_name)
75
if (now - cache->stamp > (CACHE_VALIDITY_SEC * 1000000))
77
- PolkitAuthority *authority;
78
- PolkitSubject *subject;
79
- PolkitAuthorizationResult *res;
81
- authority = polkit_authority_get_sync (NULL, NULL);
82
- subject = polkit_unix_session_new_for_process_sync (getpid (), NULL, NULL);
84
- res = polkit_authority_check_authorization_sync (authority,
86
- "org.freedesktop.timedate1.set-timezone",
88
- POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE,
92
- cache->stamp = g_get_monotonic_time ();
98
- if (polkit_authorization_result_get_is_authorized (res))
100
- else if (polkit_authorization_result_get_is_challenge (res))
105
- g_object_unref (res);
108
- g_object_unref (authority);
109
- g_object_unref (subject);
110
+ if (!cache->in_progress)
112
+ GDBusConnection *system_bus = get_system_bus (NULL);
114
+ if (system_bus != NULL)
115
+ g_dbus_connection_call (system_bus, MECHANISM_BUS_NAME,
116
+ MECHANISM_OBJECT_PATH, MECHANISM_INTERFACE,
117
+ method_name, NULL, G_VARIANT_TYPE ("(i)"),
118
+ G_DBUS_CALL_FLAGS_NONE, -1, NULL,
119
+ can_set_call_finished, cache);
121
+ /* Even if the system bus was NULL, we want to set this in
122
+ * order to effectively wedge ourselves from ever trying
125
+ cache->in_progress = TRUE;
132
g_dbus_connection_call (system_bus, MECHANISM_BUS_NAME,
133
MECHANISM_OBJECT_PATH, MECHANISM_INTERFACE,
134
- "SetTimezone", g_variant_new ("(sb)", tz, TRUE),
135
+ "SetTimezone", g_variant_new ("(s)", tz, TRUE),
136
NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL,
137
callback, user_data);
139
Index: gnome-panel-3.3.5/configure.ac
140
===================================================================
141
--- gnome-panel-3.3.5.orig/configure.ac 2012-02-06 06:18:37.000000000 -0500
142
+++ gnome-panel-3.3.5/configure.ac 2012-02-07 22:57:41.201548946 -0500
147
-PKG_CHECK_MODULES(CLOCK, pango >= $PANGO_REQUIRED gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED $LIBECAL_REQUIREMENT librsvg-2.0 gweather-3.0 >= $GWEATHER_REQUIRED gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED polkit-gobject-1)
148
+PKG_CHECK_MODULES(CLOCK, pango >= $PANGO_REQUIRED gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED $LIBECAL_REQUIREMENT librsvg-2.0 gweather-3.0 >= $GWEATHER_REQUIRED gnome-desktop-3.0 >= $LIBGNOME_DESKTOP_REQUIRED)
149
AC_SUBST(CLOCK_CFLAGS)