From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Menu bar items structure Date: Thu, 17 Nov 2022 18:06:24 +0800 Message-ID: <87o7t5gajj.fsf@yahoo.com> References: <87pmdmkdrh.fsf@elite.giraud> <83iljednq6.fsf@gnu.org> <87sfiiezv0.fsf@yahoo.com> <87cz9lkino.fsf@elite.giraud> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3400"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Manuel Giraud Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 17 11:07:40 2022 Return-path: Envelope-to: ged-emacs-devel@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 1ovbo3-0000dH-H6 for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Nov 2022 11:07:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovbnH-0002vi-2T; Thu, 17 Nov 2022 05:06:51 -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 1ovbn5-0002sA-82 for emacs-devel@gnu.org; Thu, 17 Nov 2022 05:06:40 -0500 Original-Received: from sonic302-21.consmr.mail.ne1.yahoo.com ([66.163.186.147]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovbn3-00067V-K7 for emacs-devel@gnu.org; Thu, 17 Nov 2022 05:06:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1668679595; bh=t7UPmrZM6uq/zVhkHnlpLtHcW5ILKFvJxnPFxlAHk3s=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=DTd4zI5+xM+ENL+xyfxVhQeHgrbY2S4kY+hTjP/vydg0LjKY9mkaZQYahxtNjDf5pHZ+Wx3BUZUtch/0AXq9Cs+8oiaKXnwNFx1fGZLzkH7UDQ0UFzymOUeYmMTyDWjgduk6UxKiz3KCk2LNU+Hmr4Nhv0wvICDBE29RfIkrJAdAVNC1OAWaTp8nZlPrH2JlHb4u4hiD0GWexanqBtzhrCr70vP72nuCBez9fOjf4nvMGXPSo5tgdXzZi0M8g4p+/jLwTa3b69PR7Cyxi2ZJ8GKh0InuT4CfcHKbsOxT8SFsBrwy/GOPrzrVczHDj/42Wa/2OfbwDUWMbzP20pWd1w== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1668679595; bh=pc3cqU1I+6edN8Z8FmBClRIQN/RI7FamDu2WQFc8ITV=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=djDzSBdnO369p5hNWnFIFz+9eSksEoYgqwGXH/3RFoKXPrXtlT8vdch09lI7YOSHEwinm8fPLqCHMM8xuISd8qL/FvC7wdNZmJTHIOz77VvgNVOkNddU+pyNUHr9Ffat6ZP8sXS4Ha8oA61+lP1oP/U3dCF/mV5z22QfQZ6ov5lOkOQB01aye61m4rkbmv0Z3m0izbiKQPHy3gB5NAXpn8W8NXQRAnYZxbe2MXHWJRK7UNybYkCg8eT6j4FzLe4jTb0romVnWCPx3pZJK4kztUe/nRAIG94M0Dr/Tk/fO5yuhATUwwUoJjZcm6KonYuwR5oaH+iVoyp7F8HEk1DNMg== X-YMail-OSG: ZRPdJWsVM1lZeddCSEx3Pe4TJ.lmLfdUgKWOopAxCd8f6Uky6PMgS_1XxDIZIW9 LH2paZuEO4KYJyJuVzKGL2WKxIGTSyVe12YxoX8tgEw6PHAYuG9lLvfleN0w1yRzff8OvhUBazke 3t4FfV9LBTP5692AWAHmmzwKRF8FW1GvP_qQRR.niMz5FivPLF_vMGcI4f2FmH7cUVoFNPmw7W1f lQ9WVUohRbN75YDpcp07TmZMxoKrbNNbQq4YiD9WpphoLCoDz.1GBgj281n0pLk9I.QDpQdaCESV WUOt2aAHXXeWt0nMgMyCq8hKmuySzp8tNXH9rOi2qKg70OQxVy2.1YMO69R2Y2ZbH_YhUO3vzfv4 Dzk0p4L7ihi0HtdfwDYAaeuUy7zujrqMp5rdIWN7V.dUtrr5BwrJneiBU2T1AjCSkxFxks_HnqCc NREb7FNpd.ElyYdmPM6SU1bYp4X8RfqSRvZcnqCoc8reCrxI48v8wpulXBNuUkrEODocpn6RN5zz bWpa68JhRpCBpB9eVE1yYw7j0CX8JJ.5_zocxraKARQ7sHQ7kU5VR9uz3l52CTSQ_O4sTM239rh2 XFXadyz0_i1d9Z2yRIXYS0UfE42V35eVajeGnKiF7.PaeenyM36IsUYiRaXYisAfPntygba5xMjT X5QydQQFFJWplJG1LOPFzPAGhRzZmN_kQ9.fV01XEmZhCsTi_ZLFMP_KJ16pJdrja0fi_MAqNSAb Eb1.Jm6.7noLewtTW7B.kT5jQr7fAUzBKii1yBqCROmm6K9pl19Ngs9sy7iezqGuzYPQ5g.LqLei 0.4sqhSktyQMxNFsWzVVPlmwem4T5ruc_UsL5BQh0f X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.ne1.yahoo.com with HTTP; Thu, 17 Nov 2022 10:06:35 +0000 Original-Received: by hermes--production-sg3-6c8895b545-qz6cd (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 6644213593795c0ef7af7db88d8955e5; Thu, 17 Nov 2022 10:06:29 +0000 (UTC) In-Reply-To: <87cz9lkino.fsf@elite.giraud> (Manuel Giraud's message of "Thu, 17 Nov 2022 10:57:31 +0100") X-Mailer: WebService/1.1.20863 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.186.147; envelope-from=luangruo@yahoo.com; helo=sonic302-21.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300034 Archived-At: Manuel Giraud writes: > That is unfortunate. I was not trying to change the internal menu > representation for the sake of change but I have a problem with the no > toolkit menu bar. > > The 4th element of a menu item is a char position in the menu bar for > this menu entry (filled with xdisp.c/display_menu_bar). This char > position is then used to identify if mouse click is on this menu entry > (around line 6000 of keyboard.c)=E2=80=A6 but that does not work well if = you > have changed your menu face font (eg. with (set-face-font 'menu > "AnotherFont-20")). This seems to be because pixel_to_glyph_coords will > then be off. > > To overcome this issue my idea was two fold: > > 1- change the semantics of this index from a char position to a > pixel position >=20=20=20=20=20=20=20=20=20=20 > 2- add a fifth element to a menu item that records the end > position of a menu entry (also in pixel and filled in > display_menu_bar) > > I have a patch that does just that and it seems to work for me=E2=84=A2= =E2=80=A6 but I > see that it will also impact every other *term (on system I cannot even > test). This led me to this kind of "refactoring" question. Any ideas? Why use pixel_to_glyph_coords? Why not use x_y_to_hpos_vpos on the menu bar pseudo-window?