* "ignore Y" in make_lispy_event
@ 2010-11-26 13:43 Eli Zaretskii
2010-11-26 15:47 ` Chong Yidong
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2010-11-26 13:43 UTC (permalink / raw)
To: Chong Yidong; +Cc: emacs-devel
A comment in keyboard.c:make_lispy_event says:
/* 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. */
The code below that, introduced in revno 102413, indeed "ignores Y",
in that it leaves yret at its initial zero value. This breaks mouse
clicks on the mode line that pop up menus via x-popup-menu: the menu
is popped at the top of the frame/window, instead of at the place of
the click.
Chong, did you have good reasons to "ignore Y"? If not, the simple
patch below restores the correct behavior of the popup menus:
=== modified file 'src/keyboard.c'
--- src/keyboard.c 2010-11-20 14:51:25 +0000
+++ src/keyboard.c 2010-11-26 13:33:31 +0000
@@ -5305,6 +5305,7 @@ make_lispy_position (struct frame *f, Li
? 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. */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: "ignore Y" in make_lispy_event
2010-11-26 13:43 "ignore Y" in make_lispy_event Eli Zaretskii
@ 2010-11-26 15:47 ` Chong Yidong
2010-11-26 16:11 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Chong Yidong @ 2010-11-26 15:47 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> A comment in keyboard.c:make_lispy_event says:
>
> /* 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. */
>
> The code below that, introduced in revno 102413, indeed "ignores Y",
> in that it leaves yret at its initial zero value. This breaks mouse
> clicks on the mode line that pop up menus via x-popup-menu: the menu
> is popped at the top of the frame/window, instead of at the place of
> the click.
>
> Chong, did you have good reasons to "ignore Y"? If not, the simple
> patch below restores the correct behavior of the popup menus:
I was working using the Elisp manual as a spec:
X, Y
These are the pixel coordinates of the click, relative to the
top left corner of WINDOW, which is `(0 . 0)'. For the mode
or header line, Y does not have meaningful data. For the
vertical line, X does not have meaningful data.
If there is existing code that relies on undocumented behavior, then we
should indeed restore the old behavior, and document it in the manual.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: "ignore Y" in make_lispy_event
2010-11-26 15:47 ` Chong Yidong
@ 2010-11-26 16:11 ` Eli Zaretskii
2010-11-26 18:17 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2010-11-26 16:11 UTC (permalink / raw)
To: Chong Yidong; +Cc: emacs-devel
> From: Chong Yidong <cyd@stupidchicken.com>
> Cc: emacs-devel@gnu.org
> Date: Fri, 26 Nov 2010 10:47:12 -0500
>
> I was working using the Elisp manual as a spec:
>
> X, Y
> These are the pixel coordinates of the click, relative to the
> top left corner of WINDOW, which is `(0 . 0)'. For the mode
> or header line, Y does not have meaningful data. For the
> vertical line, X does not have meaningful data.
>
> If there is existing code that relies on undocumented behavior, then we
> should indeed restore the old behavior, and document it in the manual.
Will do, thanks for the pointer.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: "ignore Y" in make_lispy_event
2010-11-26 16:11 ` Eli Zaretskii
@ 2010-11-26 18:17 ` Eli Zaretskii
0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2010-11-26 18:17 UTC (permalink / raw)
To: cyd, emacs-devel
> Date: Fri, 26 Nov 2010 18:11:12 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: emacs-devel@gnu.org
>
> > From: Chong Yidong <cyd@stupidchicken.com>
> > Cc: emacs-devel@gnu.org
> > Date: Fri, 26 Nov 2010 10:47:12 -0500
> >
> > I was working using the Elisp manual as a spec:
> >
> > X, Y
> > These are the pixel coordinates of the click, relative to the
> > top left corner of WINDOW, which is `(0 . 0)'. For the mode
> > or header line, Y does not have meaningful data. For the
> > vertical line, X does not have meaningful data.
> >
> > If there is existing code that relies on undocumented behavior, then we
> > should indeed restore the old behavior, and document it in the manual.
>
> Will do, thanks for the pointer.
Done.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-26 18:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-26 13:43 "ignore Y" in make_lispy_event Eli Zaretskii
2010-11-26 15:47 ` Chong Yidong
2010-11-26 16:11 ` Eli Zaretskii
2010-11-26 18:17 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).