From: Kaj-Michael Lang Date: Sat, 3 Nov 2007 19:51:36 +0000 (+0200) Subject: Use idle callback to bring up POI info, as otherwise the hildon context menu will... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a2d553e007be09e77bc2911c0a87cd550c715a1;p=mapper Use idle callback to bring up POI info, as otherwise the hildon context menu will pop up. --- diff --git a/src/map.c b/src/map.c index dfd22c1..309e9bc 100644 --- a/src/map.c +++ b/src/map.c @@ -1166,6 +1166,16 @@ before[1]=0; map_drag_id=0; } +/* Workaround hildon content menu problem */ +static gboolean +map_cb_show_poi_info_dialog(gpointer data) +{ +guint poi_id=GPOINTER_TO_INT(data); +if (poi_info_dialog(poi_id)==FALSE) + g_printerr("Huh? Failed to display info dialog\n"); +return FALSE; +} + gboolean map_cb_button_press(GtkWidget * widget, GdkEventButton * event) { @@ -1192,11 +1202,11 @@ case 1: unit2latlon(ux, uy, lat, lon); if (map_poi_find_at_latlon(lat, lon, &poi_id)==TRUE) { g_printf("POI: %d\n", poi_id); - if (poi_info_dialog(poi_id)==FALSE) - g_printerr("Huh? Failed to display info dialog\n"); + g_idle_add_full(G_PRIORITY_HIGH_IDLE,(GSourceFunc)map_cb_show_poi_info_dialog, GINT_TO_POINTER(poi_id), NULL); } else { map_drag_start(event->x, event->y); } + return FALSE; break; case 2: map_set_zoom(_zoom - 1);