From: Manuel Giraud <manuel@ledu-giraud.fr>
To: Eli Zaretskii <eliz@gnu.org>
Cc: luangruo@yahoo.com, 59351@debbugs.gnu.org
Subject: bug#59351: 29.0.50; [PATCH] Fix mouse click position to menu bar entry
Date: Fri, 25 Nov 2022 15:55:18 +0100 [thread overview]
Message-ID: <87fse7jd7t.fsf@elite.giraud> (raw)
In-Reply-To: <83y1s1y3vg.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 23 Nov 2022 19:31:15 +0200")
[-- Attachment #1: Type: text/plain, Size: 123 bytes --]
Hi,
I've come up with this solution that works for me. Upon menu face
change, the menu bar is correctly updated. WDYT?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-src-xdisp.c-display_menu_bar-Update-menu_bar_window-.patch --]
[-- Type: text/x-patch, Size: 1692 bytes --]
From 0ca358c52ed9641fdd16eed8db20475b619433dd Mon Sep 17 00:00:00 2001
From: Manuel Giraud <manuel@ledu-giraud.fr>
Date: Fri, 25 Nov 2022 15:50:41 +0100
Subject: [PATCH] ; * src/xdisp.c (display_menu_bar): Update menu_bar_window
height.
---
src/xdisp.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/xdisp.c b/src/xdisp.c
index 5dcf21dc4c..14003ed5f6 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -26272,11 +26272,11 @@ display_menu_bar (struct window *w)
it.first_visible_x = 0;
it.last_visible_x = FRAME_PIXEL_WIDTH (f);
#elif defined (HAVE_X_WINDOWS) /* X without toolkit. */
+ struct window *menu_w;
if (FRAME_WINDOW_P (f))
{
/* Menu bar lines are displayed in the desired matrix of the
dummy window menu_bar_window. */
- struct window *menu_w;
menu_w = XWINDOW (f->menu_bar_window);
init_iterator (&it, menu_w, -1, -1, menu_w->desired_matrix->rows,
MENU_FACE_ID);
@@ -26335,6 +26335,22 @@ display_menu_bar (struct window *w)
/* Compute the total height of the lines. */
compute_line_metrics (&it);
+
+#if defined (HAVE_X_WINDOWS) && !defined (USE_X_TOOLKIT) && !defined (USE_GTK)
+ if (FRAME_WINDOW_P (it.f))
+ {
+ struct glyph_row *row = it.glyph_row;
+ int delta_height = ((row->y + row->height)
+ - WINDOW_BOX_HEIGHT_NO_MODE_LINE (menu_w));
+ if (delta_height != 0)
+ {
+ FRAME_MENU_BAR_HEIGHT (it.f) += delta_height;
+ WINDOW_PIXEL_HEIGHT (w) -= delta_height;
+ WINDOW_TOP_PIXEL_EDGE (w) += delta_height;
+ it.f->fonts_changed = true;
+ }
+ }
+#endif
}
/* Deep copy of a glyph row, including the glyphs. */
--
2.38.1
[-- Attachment #3: Type: text/plain, Size: 18 bytes --]
--
Manuel Giraud
next prev parent reply other threads:[~2022-11-25 14:55 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 8:37 bug#59351: 29.0.50; [PATCH] Fix mouse click position to menu bar entry Manuel Giraud
2022-11-18 10:43 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-18 11:01 ` Manuel Giraud
2022-11-18 11:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-18 12:10 ` Manuel Giraud
2022-11-18 13:19 ` Eli Zaretskii
2022-11-18 13:24 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-18 11:58 ` Eli Zaretskii
2022-11-18 12:15 ` Manuel Giraud
2022-11-18 12:29 ` Eli Zaretskii
2022-11-18 12:41 ` Manuel Giraud
2022-11-18 12:51 ` Eli Zaretskii
2022-11-18 13:12 ` Manuel Giraud
2022-11-18 13:23 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-18 13:40 ` Manuel Giraud
2022-11-18 14:08 ` Manuel Giraud
2022-11-18 14:14 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-18 14:31 ` Eli Zaretskii
2022-11-18 13:20 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-18 13:20 ` Manuel Giraud
2022-11-18 14:30 ` Eli Zaretskii
2022-11-18 15:20 ` Manuel Giraud
2022-11-18 15:26 ` Eli Zaretskii
2022-11-18 17:23 ` Manuel Giraud
2022-11-18 18:45 ` Eli Zaretskii
2022-11-21 13:40 ` Manuel Giraud
2022-11-21 14:23 ` Eli Zaretskii
2022-11-21 14:46 ` Manuel Giraud
2022-11-21 18:12 ` Eli Zaretskii
2022-11-22 0:34 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-23 16:43 ` Manuel Giraud
2022-11-23 17:31 ` Eli Zaretskii
2022-11-24 13:49 ` Manuel Giraud
2022-11-25 14:55 ` Manuel Giraud [this message]
2022-11-25 15:00 ` Manuel Giraud
2022-11-26 12:49 ` Eli Zaretskii
2022-11-26 17:26 ` Manuel Giraud
2022-11-26 17:38 ` Eli Zaretskii
2022-11-27 0:51 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-27 6:40 ` Eli Zaretskii
2022-11-28 17:07 ` Manuel Giraud
2022-11-29 0:47 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-29 8:00 ` Manuel Giraud
2022-11-29 9:37 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-01 10:30 ` Manuel Giraud
2022-11-29 12:14 ` Eli Zaretskii
2022-11-29 12:19 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-01 12:31 ` Eli Zaretskii
2022-12-01 16:23 ` Manuel Giraud
2022-12-01 16:50 ` Eli Zaretskii
2022-11-19 0:22 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-19 9:19 ` Manuel Giraud
2022-11-18 11:42 ` Eli Zaretskii
2022-11-18 12:12 ` Manuel Giraud
2022-11-18 12:26 ` Eli Zaretskii
2022-11-18 13:16 ` Manuel Giraud
2022-11-18 14:16 ` Eli Zaretskii
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=87fse7jd7t.fsf@elite.giraud \
--to=manuel@ledu-giraud.fr \
--cc=59351@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=luangruo@yahoo.com \
/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.