GNU bug report logs - #59351
29.0.50; [PATCH] Fix mouse click position to menu bar entry

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Fri, 18 Nov 2022 08:38:02 UTC

Severity: normal

Tags: patch

Found in version 29.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: luangruo <at> yahoo.com, 59351 <at> debbugs.gnu.org
Subject: bug#59351: 29.0.50; [PATCH] Fix mouse click position to menu bar entry
Date: Wed, 23 Nov 2022 17:43:39 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

[...]

>> About the height of the menu bar, you were right.  I've tested and
>> display_menu_bar is called quite often and is called after a
>> (set-face-font 'menu "Iosevka-18").  So maybe it is the last call to
>> compute_line_metrics that does not do the required job.
>
> I suggest to step through the code there and see why that happens.
> Feel free to describe what you see if the reason is not obvious.

Hi,

I think I might be onto something for the misbehaving update of the menu
bar height when changing font face (in --with-x-toolkit=no build).

The main difficulty was to set correct breakpoint because
display_menu_bar is called quite often.  So I'm starting my GDB session
with:

--8<---------------cut here---------------start------------->8---
set args -Q
break xdisp.c:3412 if ((base_face_id == MENU_FACE_ID) && (face->font->height > 14))
run
--8<---------------cut here---------------end--------------->8---

I think the previous 14 in the breakpoint should be adapt to not trigger
at the initial face and to do trigger after face font changed.  Then
from the scracth buffer of this emacs, I type: (set-face-font 'menu
"Iosevka-18") and evaluate it.  The breakpoint triggers as this font is
quite big.

Then from GDB, I do:

--8<---------------cut here---------------start------------->8---
tbreak 26337
continue
step
--8<---------------cut here---------------end--------------->8---

This last step goes into this compute_line_metrics call.  Everything
seems fine up to xdisp.c:22886.  Before this conditional, I have the
following values:

--8<---------------cut here---------------start------------->8---
row->y = 0
row->height = 31
row->visible_height = 31
max_y = 13
--8<---------------cut here---------------end--------------->8---

And so after it, row->visible_height becomes 13.  So maybe that is why
the menu bar is not update to have more height here.  WDYT?
-- 
Manuel Giraud




This bug report was last modified 2 years and 250 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.