[vte/vte-next: 68/223] Use _vte_terminal_xy_to_grid in vte_terminal_maybe_send_mouse_drag
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next: 68/223] Use _vte_terminal_xy_to_grid in vte_terminal_maybe_send_mouse_drag
- Date: Wed, 22 Jun 2011 20:54:19 +0000 (UTC)
commit 45c88df6127822204c0beb821670b5fb38550716
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 1e9b91f..6e2dd46 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -5215,10 +5215,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) {
@@ -5233,8 +5232,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]