From: Eli Zaretskii <eliz@gnu.org>
To: Manuel Giraud <manuel@ledu-giraud.fr>
Cc: luangruo@yahoo.com, emacs-devel@gnu.org
Subject: Re: Menu bar items structure
Date: Thu, 17 Nov 2022 13:16:29 +0200 [thread overview]
Message-ID: <834juxesqa.fsf@gnu.org> (raw)
In-Reply-To: <87cz9lkino.fsf@elite.giraud> (message from Manuel Giraud on Thu, 17 Nov 2022 10:57:31 +0100)
> From: Manuel Giraud <manuel@ledu-giraud.fr>
> Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
> Date: Thu, 17 Nov 2022 10:57:31 +0100
>
> The 4th element of a menu item is a char position in the menu bar for
> this menu entry (filled with xdisp.c/display_menu_bar). This char
> position is then used to identify if mouse click is on this menu entry
> (around line 6000 of keyboard.c)… but that does not work well if you
> have changed your menu face font (eg. with (set-face-font 'menu
> "AnotherFont-20")). This seems to be because pixel_to_glyph_coords will
> then be off.
>
> To overcome this issue my idea was two fold:
>
> 1- change the semantics of this index from a char position to a
> pixel position
>
> 2- add a fifth element to a menu item that records the end
> position of a menu entry (also in pixel and filled in
> display_menu_bar)
The first alternative is better, IMO: on TTY frames each character is
1 pixel, so the change doesn't affect TTY menus.
next prev parent reply other threads:[~2022-11-17 11:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-16 17:30 Menu bar items structure Manuel Giraud
2022-11-17 7:49 ` Eli Zaretskii
2022-11-17 8:42 ` Po Lu
2022-11-17 9:57 ` Manuel Giraud
2022-11-17 10:06 ` Po Lu
2022-11-17 10:09 ` Manuel Giraud
2022-11-17 11:15 ` Po Lu
2022-11-17 11:17 ` Po Lu
2022-11-17 11:16 ` Eli Zaretskii [this message]
2022-11-17 15:06 ` Manuel Giraud
2022-11-17 17:01 ` Eli Zaretskii
2022-11-18 7:48 ` Manuel Giraud
2022-11-17 9:23 ` Manuel Giraud
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=834juxesqa.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=luangruo@yahoo.com \
--cc=manuel@ledu-giraud.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.