[vte/vte-next: 67/114] 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: 67/114] Use _vte_terminal_xy_to_grid in vte_terminal_maybe_send_mouse_drag
- Date: Mon, 30 May 2011 17:12:22 +0000 (UTC)
commit 663a02702317a43a9938141fd77561a2481934ba
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 88789e2..f98eeb8 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]