[vte/vte-next] Use _vte_terminal_xy_to_grid in vte_terminal_maybe_send_mouse_drag



commit bac7bb64b6c700e1a5cf2d049e7bfa05ba7e60ea
Author: Christian Persch <chpe gnome org>
Date:   Thu May 12 14:45:26 2011 +0200

    Use _vte_terminal_xy_to_grid in vte_terminal_maybe_send_mouse_drag

 src/vte.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index d2a0d1c..a522580 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -5217,10 +5217,9 @@ vte_terminal_maybe_send_mouse_drag(VteTerminal *terminal, GdkEventMotion *event)
 	unsigned char cb, cx, cy;
 	char buf[LINE_MAX];
 	gint len;
-	int width = terminal->pvt->char_width;
-	int height = terminal->pvt->char_height;
-	long col = ((long) event->x - terminal->pvt->padding.left) / width;
-	long row = ((long) event->y - terminal->pvt->padding.top) / height;
+        long col, row;
+
+        (void) _vte_terminal_xy_to_grid(terminal, event->x, event->y, &col, &row);
 
 	/* First determine if we even want to send notification. */
 	switch (event->type) {
@@ -5235,8 +5234,8 @@ vte_terminal_maybe_send_mouse_drag(VteTerminal *terminal, GdkEventMotion *event)
 			}
 			/* the xterm doc is not clear as to whether
 			 * all-tracking also sends degenerate same-cell events */
-			if (col == terminal->pvt->mouse_last_x / width &&
-			    row == terminal->pvt->mouse_last_y / height)
+			if (col == terminal->pvt->mouse_last_cell_x &&
+			    row == terminal->pvt->mouse_last_cell_y)
 				return;
 		}
 		break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]