From: Kaj-Michael Lang Date: Tue, 29 Jan 2008 16:39:34 +0000 (+0200) Subject: Do the info update callbacks in as idle X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5676a2b6d516455a6e31e1e23c4fdd57ac889d4f;p=mapper Do the info update callbacks in as idle --- diff --git a/src/gps.c b/src/gps.c index 08e3f31..15cb552 100644 --- a/src/gps.c +++ b/src/gps.c @@ -672,6 +672,12 @@ switch (status) { gps->io.nmea=g_strdup(gps->io.buffer); g_assert(gps->io.nmea); g_idle_add_full(G_PRIORITY_HIGH_IDLE, (GSourceFunc)gps_nmea_parse, gps, NULL); + + if (gps->update_info) + g_idle_add_full(G_PRIORITY_DEFAULT, (GSourceFunc)gps->update_info, gps, NULL); + + if (gps->update_satellite) + g_idle_add_full(G_PRIORITY_DEFAULT, (GSourceFunc)gps->update_satellite, gps, NULL); } else { /* There was a checksum, and it was bad. */ g_printerr("%s: Bad checksum in NMEA sentence:\n%s\n", __PRETTY_FUNCTION__, gps->io.buffer); diff --git a/src/gps.h b/src/gps.h index fa7afda..f2758fc 100644 --- a/src/gps.h +++ b/src/gps.h @@ -121,8 +121,8 @@ struct _Gps { /* New location */ void(* update_location)(Gps *gps, gboolean newly_fixed); - void(* update_satellite)(Gps *gps); - void(* update_info)(Gps *gps); + gboolean(* update_satellite)(Gps *gps); + gboolean(* update_info)(Gps *gps); }; Gps *_gps; diff --git a/src/ui-common.c b/src/ui-common.c index 1fe5f20..61c5000 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -807,12 +807,18 @@ g_assert(gps); if (_gps_info) gps_display_data(&gps->data); +gps_display_data_speed(info_banner.speed, gps->data.speed); + +return FALSE; +} + +gboolean +gps_satellite_update(Gps *gps) +{ if (_satdetails_on) gps_display_details(&gps->data); -gps_display_data_speed(info_banner.speed, gps->data.speed); - -return TRUE; +return FALSE; } gboolean