diff options
-rw-r--r-- | debian/changelog | 10 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rwxr-xr-x | debian/rules | 2 | ||||
-rw-r--r-- | src/datetime-service.c | 19 | ||||
-rw-r--r-- | src/indicator-datetime.c | 51 |
5 files changed, 51 insertions, 33 deletions
diff --git a/debian/changelog b/debian/changelog index 3223098..9b37333 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +indicator-datetime (12.10.3daily13.05.02-0ubuntu1) saucy; urgency=low + + [ Charles Kerr ] + * g_critical hit when datetime indicator first shown (LP: #1175392) + + [ Ubuntu daily release ] + * Automatic snapshot from revision 213 + + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 02 May 2013 22:59:08 +0000 + indicator-datetime (12.10.3daily13.03.26-0ubuntu1) raring; urgency=low * Use systemd's service backend, ffe lp: #1153567 diff --git a/debian/control b/debian/control index 7645232..41bdb0f 100644 --- a/debian/control +++ b/debian/control @@ -41,7 +41,7 @@ Depends: ${shlibs:Depends}, gnome-control-center, geoclue-ubuntu-geoip | geoclue-provider, systemd-services, - systemd-shim + systemd-shim, Recommends: indicator-applet | indicator-renderer, evolution-data-server, Description: Simple clock diff --git a/debian/rules b/debian/rules index f98cf93..a350b13 100755 --- a/debian/rules +++ b/debian/rules @@ -9,7 +9,7 @@ override_dh_autoreconf: NOCONFIGURE=1 dh_autoreconf ./autogen.sh override_dh_auto_configure: - dh_auto_configure -- --disable-static + dh_auto_configure -- --disable-static --disable-silent-rules override_dh_install: find debian/indicator-datetime -name \*.la -delete diff --git a/src/datetime-service.c b/src/datetime-service.c index 6f3cf7b..cd8f7a6 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -1154,11 +1154,12 @@ static void session_active_change_cb (GDBusProxy * proxy, gchar * sender_name, gchar * signal_name, GVariant * parameters, gpointer user_data) { - // Just returned from suspend - if (g_strcmp0(signal_name, "SystemIdleHintChanged") == 0) { - gboolean idle = FALSE; - g_variant_get(parameters, "(b)", &idle); - if (!idle) { + // Suspending / returning from suspend (true / false) + if (g_strcmp0(signal_name, "PrepareForSleep") == 0) { + gboolean sleeping = FALSE; + g_variant_get (parameters, "(b)", &sleeping); + if (!sleeping) { + g_debug ("System has been resumed; adjusting clock"); on_clock_skew (); } } @@ -1174,7 +1175,7 @@ system_proxy_cb (GObject * object, GAsyncResult * res, gpointer user_data) GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error); if (error != NULL) { - g_warning("Could not grab DBus proxy for ConsoleKit: %s", error->message); + g_warning("Could not grab DBus proxy for logind: %s", error->message); g_clear_error (&error); return; } @@ -1482,9 +1483,9 @@ main (int argc, char ** argv) g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, G_DBUS_PROXY_FLAGS_NONE, NULL, - "org.freedesktop.ConsoleKit", - "/org/freedesktop/ConsoleKit/Manager", - "org.freedesktop.ConsoleKit.Manager", + "org.freedesktop.login1", + "/org/freedesktop/login1", + "org.freedesktop.login1.Manager", NULL, system_proxy_cb, dbus); mainloop = g_main_loop_new(NULL, FALSE); diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 9546664..f7d1a78 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -266,28 +266,35 @@ indicator_datetime_class_init (IndicatorDatetimeClass *klass) } static void -menu_visible_notfy_cb(GtkWidget * menu, G_GNUC_UNUSED GParamSpec *pspec, gpointer user_data) +menu_visible_notify_cb(GtkWidget * menu, G_GNUC_UNUSED GParamSpec *pspec, gpointer user_data) { - GtkWidget * w; - GtkCalendar * calendar; - IndicatorDatetime * self = INDICATOR_DATETIME(user_data); - GDateTime *datetime; - gint cur_y, cur_m, cur_d; - guint cal_y, cal_m, cal_d; - - g_debug("notify visible signal received"); - - /* set the calendar to today's date */ - datetime = g_date_time_new_now_local (); - g_date_time_get_ymd (datetime, &cur_y, &cur_m, &cur_d); - g_date_time_unref (datetime); - w = ido_calendar_menu_item_get_calendar (self->priv->ido_calendar); - calendar = GTK_CALENDAR(w); - gtk_calendar_get_date (calendar, &cal_y, &cal_m, &cal_d); - if ((cur_y != cal_y) || (cur_m-1 != cal_m)) - gtk_calendar_select_month (calendar, cur_m-1, cur_y); /* (cur_m is 1-based) */ - if (cur_d != cal_d) - gtk_calendar_select_day (calendar, cur_d); + IndicatorDatetime * self; + g_debug ("notify visible signal received"); + + self = INDICATOR_DATETIME (user_data); + g_assert (self != NULL); + + /* if the calendar widget's been created, set it to today's datë */ + if (self->priv->ido_calendar != NULL) { + GtkWidget * w; + GtkCalendar * calendar; + gint cur_y, cur_m, cur_d; + guint cal_y, cal_m, cal_d; + GDateTime * datetime = g_date_time_new_now_local (); + + g_date_time_get_ymd (datetime, &cur_y, &cur_m, &cur_d); + w = ido_calendar_menu_item_get_calendar (self->priv->ido_calendar); + calendar = GTK_CALENDAR(w); + g_return_if_fail (calendar != NULL); + + gtk_calendar_get_date (calendar, &cal_y, &cal_m, &cal_d); + if ((cur_y != cal_y) || (cur_m-1 != cal_m)) + gtk_calendar_select_month (calendar, cur_m-1, cur_y); /* (cur_m is 1-based) */ + if (cur_d != cal_d) + gtk_calendar_select_day (calendar, cur_d); + + g_date_time_unref (datetime); + } /* Update in case date was changed outside of indicator-datetime */ update_label(self, NULL); @@ -380,7 +387,7 @@ indicator_datetime_init (IndicatorDatetime *self) self->priv->menu = dbusmenu_gtkmenu_new(SERVICE_NAME, MENU_OBJ); - g_signal_connect(self->priv->menu, "notify::visible", G_CALLBACK(menu_visible_notfy_cb), self); + g_signal_connect(self->priv->menu, "notify::visible", G_CALLBACK(menu_visible_notify_cb), self); DbusmenuGtkClient *client = dbusmenu_gtkmenu_get_client(self->priv->menu); dbusmenu_client_add_type_handler_full(DBUSMENU_CLIENT(client), DBUSMENU_CALENDAR_MENUITEM_TYPE, new_calendar_item, self, NULL); |