[vte/vte-next: 65/114] Use vte_terminal_xy_to_grid in vte_terminal_send_mouse_button_internal
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next: 65/114] Use vte_terminal_xy_to_grid in vte_terminal_send_mouse_button_internal
- Date: Mon, 30 May 2011 17:12:12 +0000 (UTC)
commit 250e67bb584bc4ad1a0c70aa1d167389a5da0a7c
Author: Christian Persch <chpe gnome org>
Date: Sat May 7 21:46:08 2011 +0200
Use vte_terminal_xy_to_grid in vte_terminal_send_mouse_button_internal
src/vte.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index 31540ed..bfd2a15 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -5149,6 +5149,13 @@ vte_terminal_get_mouse_tracking_info (VteTerminal *terminal,
*py = cy;
}
+/*
+ * vte_terminal_send_mouse_button_internal:
+ * @terminal:
+ * @button: the mouse button, or 0 for keyboard
+ * @x: the event X coordinate
+ * @y: the event Y coordinate
+ */
static void
vte_terminal_send_mouse_button_internal(VteTerminal *terminal,
int button,
@@ -5158,10 +5165,10 @@ vte_terminal_send_mouse_button_internal(VteTerminal *terminal,
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 = (x - terminal->pvt->padding.left) / width;
- long row = (y - terminal->pvt->padding.top) / height;
+ long col, row;
+
+ if (!_vte_terminal_xy_to_grid(terminal, x, y, &col, &row))
+ return;
vte_terminal_get_mouse_tracking_info (terminal,
button, col, row,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]