X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=blobdiff_plain;f=src%2Fbar_gps.c;h=d21b824cd4da66f5947f9f74402f8d13b8ae7341;hp=a112be6afc942db9b6f7b8f97ecab3c33230f9b4;hb=ab4c998d4835a809e10f25e3aaa3acff8b8b6538;hpb=2d3cd230c26931eec9fc02f2f76d72f7bfe5e1c4 diff --git a/src/bar_gps.c b/src/bar_gps.c index a112be6a..d21b824c 100644 --- a/src/bar_gps.c +++ b/src/bar_gps.c @@ -680,6 +680,8 @@ static gboolean bar_pane_gps_map_keypress_cb(GtkWidget *widget, GdkEventButton * { PaneGPSData *pgd = data; GtkWidget *menu; + GtkClipboard *clipboard; + gchar *geo_coords; if (bevent->button == MOUSE_BUTTON_RIGHT) { @@ -694,7 +696,17 @@ static gboolean bar_pane_gps_map_keypress_cb(GtkWidget *widget, GdkEventButton * } else if (bevent->button == MOUSE_BUTTON_LEFT) { - return FALSE; + clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); + geo_coords = g_strdup_printf("%lf %lf", + champlain_view_y_to_latitude( + CHAMPLAIN_VIEW(pgd->gps_view),bevent->y), + champlain_view_x_to_longitude( + CHAMPLAIN_VIEW(pgd->gps_view),bevent->x)); + gtk_clipboard_set_text(clipboard, geo_coords, -1); + + g_free(geo_coords); + + return TRUE; } else {