emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Menu bar items structure


From: Eli Zaretskii
Subject: Re: Menu bar items structure
Date: Thu, 17 Nov 2022 13:16:29 +0200

> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]