From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud Newsgroups: gmane.emacs.bugs Subject: bug#59351: 29.0.50; [PATCH] Fix mouse click position to menu bar entry Date: Fri, 25 Nov 2022 15:55:18 +0100 Message-ID: <87fse7jd7t.fsf@elite.giraud> References: <87tu2wlku7.fsf@elite.giraud> <878rk8ee6d.fsf@yahoo.com> <8735agr0g4.fsf@elite.giraud> <83o7t4bhk4.fsf@gnu.org> <87zgcov1ps.fsf@elite.giraud> <8335agbai5.fsf@gnu.org> <875yfcuw5r.fsf@elite.giraud> <83r0y09td6.fsf@gnu.org> <87zgcotbw9.fsf@elite.giraud> <83iljc9k5s.fsf@gnu.org> <871qpt7hac.fsf@elite.giraud> <83y1s1y3vg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11014"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: luangruo@yahoo.com, 59351@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 25 15:56:26 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oya7r-0002a3-UQ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Nov 2022 15:56:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oya7a-0001tT-Tm; Fri, 25 Nov 2022 09:56:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oya7Z-0001sj-Qy for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2022 09:56:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oya7Z-0001cA-IO for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2022 09:56:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oya7W-0004C4-FU for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2022 09:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Nov 2022 14:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59351 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59351-submit@debbugs.gnu.org id=B59351.166938812714469 (code B ref 59351); Fri, 25 Nov 2022 14:56:02 +0000 Original-Received: (at 59351) by debbugs.gnu.org; 25 Nov 2022 14:55:27 +0000 Original-Received: from localhost ([127.0.0.1]:34510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oya6w-0003lH-RK for submit@debbugs.gnu.org; Fri, 25 Nov 2022 09:55:27 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:43083) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oya6r-0003hs-9K for 59351@debbugs.gnu.org; Fri, 25 Nov 2022 09:55:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=rEzJ/9TF4dRZBvn9 EWXMa+Yh7XZhO5QDlhhiZ+np8QQ=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=O5MjIMvy7tJyhjHBO89I5BB7fXx6kZpMV8Gjeo mdrf17GWlT0POWpHdI3pTYTRi3SGlNzanNvCWoFACB5ZNaY1jNrm1dupazIki68BkERekl G9v9CxaD+D0GiTAsgQEISDq9iJNk5x57jlZLrzN8TbPhxd7jWn51Sidvirk617uY6LJ3Ac hFGMYXMdyYwnjdgbYAag+DvmGwYdoRMfeSJsxNyOVwFXVyNiJul6TTP+YAN7xz4vd98V5U a0uIgOfHbLkzRE7ZOsv7HnHf/+jcmaM+IVd7jKObRY22z07bsbPTNnG3t570Q/udNQfkgK V2tC+7UcHMwcZv+rU9QK4mfQ== Original-Received: from elite.giraud ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 843b6aec (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 25 Nov 2022 15:55:19 +0100 (CET) In-Reply-To: <83y1s1y3vg.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 23 Nov 2022 19:31:15 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249007 Archived-At: --=-=-= Content-Type: text/plain Hi, I've come up with this solution that works for me. Upon menu face change, the menu bar is correctly updated. WDYT? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-src-xdisp.c-display_menu_bar-Update-menu_bar_window-.patch >From 0ca358c52ed9641fdd16eed8db20475b619433dd Mon Sep 17 00:00:00 2001 From: Manuel Giraud 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 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=--