--- trunk/src/map-tool.c 2009/10/28 11:50:37 147 +++ trunk/src/map-tool.c 2009/10/28 11:57:54 148 @@ -109,14 +109,18 @@ static gboolean map_gps_update(gpointer data) { map_context_t *context = (map_context_t*)data; + static gboolean goto_is_enabled = FALSE; /* get reference position ... */ pos_t *refpos = get_pos(context->appdata); gboolean ok = (refpos!= NULL) && !isnan(refpos->lat) && !isnan(refpos->lon); /* ... and enable "goto" button if it's valid */ - osm_gps_map_osd_enable_gps (OSM_GPS_MAP(context->widget), - OSM_GPS_MAP_OSD_CALLBACK(ok?cb_map_gps:NULL), context); + if(ok != goto_is_enabled) { + osm_gps_map_osd_enable_gps (OSM_GPS_MAP(context->widget), + OSM_GPS_MAP_OSD_CALLBACK(ok?cb_map_gps:NULL), context); + goto_is_enabled = ok; + } if(ok) { float heading = NAN; @@ -131,6 +135,8 @@ radius = dist2pixel(context, eph/1000, refpos->lat); } + /* TODO: in order to save energy: only draw if state actually changed */ + g_object_set(context->widget, "gps-track-highlight-radius", radius, NULL); osm_gps_map_draw_gps(OSM_GPS_MAP(context->widget), refpos->lat, refpos->lon, heading);