Index: src/vte.c
===================================================================
--- src/vte.c	(revision 1599)
+++ src/vte.c	(working copy)
@@ -4903,6 +4903,40 @@
 	}
 }
 
+/**
+ * vte_terminal_translate_position:
+ * @terminal: a #VteTerminal
+ * @x: gdouble holding the x-coordinate (0 = left)
+ * @y: gdouble holding the y-coordinate (0 = top)
+ * @column: a glong which will hold the column
+ * @row : a glong which will hold the row
+ *
+ * Converts the event co-ordinate (x,y) into a cell coordinate (column, row),
+ * relative to the visible area.
+ *
+ * Returns: TRUE if the position is within the terminal.
+ *
+ * Since: 0.16
+ */
+gboolean
+vte_terminal_translate_position(VteTerminal *terminal,
+				gdouble x, gdouble y,
+				glong *column, glong *row)
+{
+	g_return_if_fail(VTE_IS_TERMINAL(terminal));
+	x = (x - VTE_PAD_WIDTH) / terminal->char_width;
+	y = (y - VTE_PAD_WIDTH) / terminal->char_height;
+	if (column) {
+		*column = floor (x);
+	}
+	if (row) {
+		*row = floor (y);
+	}
+	return x >= 0 && x < terminal->column_count &&
+		y >= 0 && y < terminal->row_count;
+}
+
+
 static GtkClipboard *
 vte_terminal_clipboard_get(VteTerminal *terminal, GdkAtom board)
 {
Index: src/vte.h
===================================================================
--- src/vte.h	(revision 1599)
+++ src/vte.h	(working copy)
@@ -351,6 +351,10 @@
 				  GArray *attributes);
 void vte_terminal_get_cursor_position(VteTerminal *terminal,
 				      glong *column, glong *row);
+gboolean
+vte_terminal_translate_position(VteTerminal *terminal,
+				gdouble x, gdouble y,
+				glong *column, glong *row);
 
 /* Display string matching:  clear all matching expressions. */
 void vte_terminal_match_clear_all(VteTerminal *terminal);
