]> Pileus Git - grits/blobdiff - src/plugins/map.c
Use threaded fetch for first tile
[grits] / src / plugins / map.c
index c787224b16aff57efaea95eab21a4182ccea02f3..d30439187dfe13b3cbd67d58f2c9ea4a8d01e3c4 100644 (file)
@@ -156,6 +156,13 @@ static void _on_location_changed(GisViewer *viewer,
        g_thread_create(_update_tiles, map, FALSE, NULL);
 }
 
+static gpointer _threaded_init(GisPluginMap *map)
+{
+       _load_tile(map->tiles, map);
+       _update_tiles(map);
+       return NULL;
+}
+
 /***********
  * Methods *
  ***********/
@@ -174,8 +181,7 @@ GisPluginMap *gis_plugin_map_new(GisViewer *viewer)
        map->viewer = g_object_ref(viewer);
 
        /* Load initial tiles */
-       _load_tile(map->tiles, map);
-       g_thread_create(_update_tiles, map, FALSE, NULL);
+       g_thread_create((GThreadFunc)_threaded_init, map, FALSE, NULL);
 
        /* Connect signals */
        map->sigid = g_signal_connect(map->viewer, "location-changed",