From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#59351: 29.0.50; [PATCH] Fix mouse click position to menu bar entry Date: Mon, 21 Nov 2022 20:12:40 +0200 Message-ID: <834jus2n3b.fsf@gnu.org> 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> <87a64k5su7.fsf@elite.giraud> <83o7t02xq2.fsf@gnu.org> <875yf85pr8.fsf@elite.giraud> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19575"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, 59351@debbugs.gnu.org, manuel@ledu-giraud.fr To: Manuel Giraud Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 21 19:13:14 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 1oxBI9-0004pz-H1 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Nov 2022 19:13:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxBI0-0002Wm-Us; Mon, 21 Nov 2022 13:13:04 -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 1oxBHz-0002V4-9t for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 13:13:03 -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 1oxBHy-00051X-Ep for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 13:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oxBHx-0007vO-Ua for bug-gnu-emacs@gnu.org; Mon, 21 Nov 2022 13:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Nov 2022 18:13:01 +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.166905436130423 (code B ref 59351); Mon, 21 Nov 2022 18:13:01 +0000 Original-Received: (at 59351) by debbugs.gnu.org; 21 Nov 2022 18:12:41 +0000 Original-Received: from localhost ([127.0.0.1]:48779 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxBHc-0007ub-HL for submit@debbugs.gnu.org; Mon, 21 Nov 2022 13:12:40 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxBHY-0007uE-9v for 59351@debbugs.gnu.org; Mon, 21 Nov 2022 13:12:39 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxBHS-0004xx-2s; Mon, 21 Nov 2022 13:12:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MoKEvN0M8ZUmjHMhbVyBWRN2kMZ6SwIjpj/1dfRk7ns=; b=BBfb+JznehKf 59/2K8Vhk2OLt+YReqUperWpWGX+M2nKMN5I/JHPiNXjW+DdWEYiD4FjTC89B0biEsMNt3y2g0n5r NmBrTx9cAMS3Yc7baWieWcLXQlB4bmzSpvTjQExq/fbYvAaoiOmEY/fmlMmjJo09Y6f5CVztlP+SA /fbyNw17GpHCaEMju3sJXLtwEHW3oeG+aP7s+jQn+sAV4Ptf/M1oX7U2p+SHn8MOzRzV760rptwU2 /SFvPsQ5Zp51bgaNAU+bFAagEmhBTGlhRxSIRi/IKxiby/BUcFrT76+OtcJ/rN4vvXL/1QMa69xVP sfrV/SqgdPIgIqKNCxDVZA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxBHR-000603-CJ; Mon, 21 Nov 2022 13:12:29 -0500 In-Reply-To: <875yf85pr8.fsf@elite.giraud> (message from Manuel Giraud on Mon, 21 Nov 2022 15:46:51 +0100) 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:248561 Archived-At: > From: Manuel Giraud > Cc: Manuel Giraud , luangruo@yahoo.com, > 59351@debbugs.gnu.org > Date: Mon, 21 Nov 2022 15:46:51 +0100 > > Eli Zaretskii writes: > > >> From: Manuel Giraud > >> Cc: Manuel Giraud , luangruo@yahoo.com, > >> 59351@debbugs.gnu.org > >> Date: Mon, 21 Nov 2022 14:40:16 +0100 > >> > >> I'm trying to debug this from "M-x gdb". I've put a breakpoint at > >> display_menu_bar but whenever I'm doing a 'next' at the init_iterator > >> call I get the following message: > >> > >> --8<---------------cut here---------------start------------->8--- > >> Thread 1 received signal SIGTRAP, Trace/breakpoint trap. > >> _thread_sys_poll () at /tmp/-:3 > >> 3 /tmp/-: No such file or directory. > >> --8<---------------cut here---------------end--------------->8--- > > > > What does "bt" show in this case? > > Here it is: > --8<---------------cut here---------------start------------->8--- > #0 _thread_sys_poll () at /tmp/-:3 > #1 0x00000a4800b10c4e in _libc_poll_cancel (fds=0x7f7ffffc52a8, nfds=1, timeout=-1) at /usr/src/lib/libc/sys/w_poll.c:27 > #2 0x00000a4798da5532 in _xcb_conn_wait (c=0xa47977e9000, cond=, vector=0x0, count=0x0) at /usr/xenocara/lib/libxcb/libxcb/../../../dist/libxcb/src/xcb_conn.c:508 > #3 0x00000a4798db7ad4 in wait_for_reply (c=0xa47977e9000, request=815, e=0x7f7ffffc53b8) at /usr/xenocara/lib/libxcb/libxcb/../../../dist/libxcb/src/xcb_in.c:522 Hmm... that's strange. Po Lu, any idea why we get SIGTRAP there? Anyway, instead of stepping with "next", try this, after the breakpoint in display_menu_bar breaks: (gdb) tbreak 26300 (gdb) continue If this works, and Emacs is stopped at line 26300, I'd suggest stepping directly into compute_line_metrics, which is called at the end of display_menu_bar: (gdb) tbreak compute_line_metrics (gdb) continue This should stop inside compute_line_metrics, and then step through it and take note of the various metrics of the glyph row that it uses to compute the height. You should see the metrics that correspond to the new font.