From 5676a2b6d516455a6e31e1e23c4fdd57ac889d4f Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Tue, 29 Jan 2008 18:39:34 +0200 Subject: [PATCH] Do the info update callbacks in as idle --- src/gps.c | 6 ++++++ src/gps.h | 4 ++-- src/ui-common.c | 12 +++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) 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 -- 2.39.5