summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gps.c3
-rw-r--r--info.c7
2 files changed, 7 insertions, 3 deletions
diff --git a/gps.c b/gps.c
index 3fd6fd67c..92835a229 100644
--- a/gps.c
+++ b/gps.c
@@ -183,13 +183,14 @@ void show_map(OsmGpsMap *map, GtkWidget **window, struct dive *dive, void (*call
gtk_container_set_border_width(GTK_CONTAINER(*window), 5);
gtk_window_set_resizable(GTK_WINDOW(*window), TRUE);
gtk_container_add(GTK_CONTAINER(*window), GTK_WIDGET(map));
+ gtk_window_set_transient_for(GTK_WINDOW(*window), GTK_WINDOW(main_window));
+ gtk_window_set_modal(GTK_WINDOW(*window), TRUE);
g_signal_connect(*window, "destroy", G_CALLBACK(on_close), (gpointer)window);
g_signal_connect(G_OBJECT(map), "scroll-event", G_CALLBACK(scroll_cb), NULL);
}
if (callback)
g_signal_connect(G_OBJECT(map), "button-press-event", G_CALLBACK(button_cb), callback);
gtk_widget_show_all(*window);
- gtk_window_present(GTK_WINDOW(*window));
if (callback)
gtk_grab_add(*window);
}
diff --git a/info.c b/info.c
index 15e15d6cd..d6e2182ce 100644
--- a/info.c
+++ b/info.c
@@ -642,8 +642,10 @@ void update_gps_entry(float lat, float lon)
{
char gps_text[45];
- print_gps_coordinates(gps_text, 45, lat, lon);
- gtk_entry_set_text(location_update.entry, gps_text);
+ if (location_update.entry) {
+ print_gps_coordinates(gps_text, 45, lat, lon);
+ gtk_entry_set_text(location_update.entry, gps_text);
+ }
}
#if HAVE_OSM_GPS_MAP
@@ -959,6 +961,7 @@ int edit_multi_dive_info(struct dive *single_dive)
update_dive(master);
}
gtk_widget_destroy(dialog);
+ location_update.entry = NULL;
return success;
}