]> err.no Git - mapper/commitdiff
Use idle callback to bring up POI info, as otherwise the hildon context menu will...
authorKaj-Michael Lang <milang@tal.org>
Sat, 3 Nov 2007 19:51:36 +0000 (21:51 +0200)
committerKaj-Michael Lang <milang@tal.org>
Sat, 3 Nov 2007 19:51:36 +0000 (21:51 +0200)
src/map.c

index dfd22c1f5fd56eb2df927e116147ad2ccb202463..309e9bcd8d77107af47a1b52b686f8a16fe325c1 100644 (file)
--- 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);