--- trunk/src/map-tool.c 2009/08/03 19:18:13 42 +++ trunk/src/map-tool.c 2009/08/04 14:07:18 44 @@ -380,26 +380,29 @@ return 1000.0*km/m_per_pix; } -#define CLICK_FUZZ (10) +#define CLICK_FUZZ (16) static gboolean on_map_button_press_event(GtkWidget *widget, GdkEventButton *event, map_context_t *context) { OsmGpsMap *map = OSM_GPS_MAP(context->widget); + /* got a press event without release event? eat it! */ + if(context->press_on != NULL) { + printf("PRESS: already\n"); + return TRUE; + } + pos_t pos = coord2pos(osm_gps_map_get_co_ordinates(map, event->x, event->y)); cache_t *nearest = map_closest(context, &pos); if(nearest) { float dist = gpx_pos_get_distance(pos, nearest->pos, FALSE); - if(dist2pixel(context, dist, nearest->pos.lat) < CLICK_FUZZ) { + if(dist2pixel(context, dist, nearest->pos.lat) < CLICK_FUZZ) context->press_on = nearest; - return TRUE; - } } - - context->press_on = NULL; + return FALSE; } @@ -415,20 +418,16 @@ cache_t *nearest = map_closest(context, &pos); if(nearest && nearest == context->press_on) { float dist = gpx_pos_get_distance(pos, nearest->pos, FALSE); - if(dist2pixel(context, dist, nearest->pos.lat) < CLICK_FUZZ) { - + if(dist2pixel(context, dist, nearest->pos.lat) < CLICK_FUZZ) cache_popup(context, nearest); - - context->press_on = NULL; - return TRUE; - } } + context->press_on = NULL; } - context->press_on = NULL; return FALSE; } + #if MAEMO_VERSION_MAJOR == 5 static void on_window_destroy(GtkWidget *widget, map_context_t *context) { printf("destroy map view\n"); @@ -472,7 +471,7 @@ #ifdef USE_MAEMO } else { map_draw_cachelist(context->widget, appdata->cur_gpx->cache); - name = g_strdup(_("appdata->cur_gpx->name")); + name = g_strdup(appdata->cur_gpx->name); } #endif