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: Wed, 23 Nov 2022 17:43:39 +0100 Message-ID: <871qpt7hac.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31414"; 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 Wed Nov 23 17:44:38 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 1oxsrW-0007wF-CI for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Nov 2022 17:44:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxsr9-0000bT-LM; Wed, 23 Nov 2022 11:44:15 -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 1oxsqy-0000ZM-Ey for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 11:44:06 -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 1oxsqx-00044P-5F for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 11:44:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oxsqx-0002yG-1R for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 11:44:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Nov 2022 16:44:03 +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.166922183311384 (code B ref 59351); Wed, 23 Nov 2022 16:44:03 +0000 Original-Received: (at 59351) by debbugs.gnu.org; 23 Nov 2022 16:43:53 +0000 Original-Received: from localhost ([127.0.0.1]:56039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxsqn-0002xY-4g for submit@debbugs.gnu.org; Wed, 23 Nov 2022 11:43:53 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:36084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxsqd-0002x5-Rl for 59351@debbugs.gnu.org; Wed, 23 Nov 2022 11:43:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=glh4+lCyLNRz4z7d 9sBCiextU2fuwzoiwWYTmxpUECc=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=MGudVXEOWtk9eaQ5uKl7X7HLIPJWgmNsz4mJ/e WkNcXCL22De1knlni/ykA9SsgBAyzFOSpPaOQTmCnItzLOr+lXkmPX6fI8zs2bOFuH6cpI tcnExbEUipdcIEr7FlMJhEr4+2P45Ow6m7jGlq0a4eXI7/CdN1DeT/txCMLKmQx/NSHHV1 uI+L/bMPY59BSVUSxnwVT/d0ifSo4CLn6FIRWF32NTZzhHHD+pjLJy+d+1V1UpI2bghMIw 11ydHm4UE75E9zIrHIM/TlO1Eejpe37o9HqL9pvYEixSpcCYE3Vjo5XyVEr71LnpGT/ncq rZ8A2BmNdXZn+erFeyMCtCqw== Original-Received: from elite.giraud ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 745796a5 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 23 Nov 2022 17:43:42 +0100 (CET) In-Reply-To: <83iljc9k5s.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Nov 2022 20:45:03 +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:248758 Archived-At: Eli Zaretskii 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