From 8547874a7cfa4e353f0307c8b614e802d8abfc21 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 26 Nov 2010 20:15:09 +0200 Subject: Fix and document components of mouse event position. src/keyboard.c (make_lispy_position): Put a meaningful value in yret when the click is on the header or mode line. doc/lispref/commands.texi (Click Events): Document the values of X, Y and COL, ROW in the event's position, when the click is on the header or mode line, on the fringes, or in the margins. --- src/ChangeLog | 5 +++++ src/keyboard.c | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 61ef9a202a8..eac550a7334 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-11-26 Eli Zaretskii + + * keyboard.c (make_lispy_position): Put a meaningful value in yret + when the click is on the header or mode line. + 2010-11-25 Eli Zaretskii * xdisp.c (set_cursor_from_row): Don't forget to consider the diff --git a/src/keyboard.c b/src/keyboard.c index e96d0167fd4..923ac1ad1d9 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5283,9 +5283,9 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, xret = XINT (x) - window_box_left (w, TEXT_AREA); yret = wy - WINDOW_HEADER_LINE_HEIGHT (w); } - /* For mode line and header line clicks, return X relative to - the left window edge; ignore Y. Use mode_line_string to look - for a string on the click position. */ + /* For mode line and header line clicks, return X, Y relative to + the left window edge. Use mode_line_string to look for a + string on the click position. */ else if (part == ON_MODE_LINE || part == ON_HEADER_LINE) { Lisp_Object string; @@ -5305,6 +5305,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, ? PT : XMARKER (w->pointm)->charpos; xret = wx; + yret = wy; } /* For fringes and margins, Y is relative to the area's (and the window's) top edge, while X is meaningless. */ -- cgit v1.3