From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Popup-menu signals quit when Aborted Date: Sat, 01 Feb 2020 17:14:54 +0200 Message-ID: <83sgjuibkh.fsf@gnu.org> References: <97CB42CE-5971-4EA5-B96C-6FA7620DDB74@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="14734"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: JD Smith Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 01 16:15:45 2020 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 1ixuUr-0003hw-H8 for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Feb 2020 16:15:45 +0100 Original-Received: from localhost ([::1]:47070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixuUq-0005rg-IB for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Feb 2020 10:15:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41904) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixuUL-0005N2-0P for emacs-devel@gnu.org; Sat, 01 Feb 2020 10:15:14 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ixuUK-0000t3-So; Sat, 01 Feb 2020 10:15:12 -0500 Original-Received: from [176.228.60.248] (port=1654 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ixuUK-0003rv-7A; Sat, 01 Feb 2020 10:15:12 -0500 In-reply-to: <97CB42CE-5971-4EA5-B96C-6FA7620DDB74@gmail.com> (message from JD Smith on Sat, 1 Feb 2020 09:51:22 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:244809 Archived-At: > From: JD Smith > Date: Sat, 1 Feb 2020 09:51:22 -0500 > > `x-popup-menu` is setup to handle mouse events specially when “aborting” the menu by clicking off of it: > > > If the user gets rid of the menu without making a valid choice, for > > instance by clicking the mouse away from a valid choice or by typing > > keyboard input, then this normally results in a quit and > > ‘x-popup-menu’ does not return. But if POSITION is a mouse button > > event (indicating that the user invoked the menu with the mouse) then > > no quit occurs and ‘x-popup-menu’ returns nil. > > This seems sensible. But `popup-menu` "normalizes" all incoming positions using `popup-menu-normalize-position`, which strips any mouse event designation in the position before passing it on. So there is no way via `popup-menu` to "indicat[e] that the user invoked the menu with the mouse”. Hence it always quits and ring the bell when the user “gets rid of the menu". > > Normalizing away mouse events in this manner seems like a bug in `popup-menu` to me, since `x-popup-menu` explicitly takes mouse events and behaves differently with them. > > See https://github.com/tarsius/minions/issues/25 for original discussion. Sorry, I don't understand the goal of the report. You seem to be talking about internal workings of popup-menu (which has to handle both GUI and text-mode menus, btw), and I don't think I understand why these internal workings are of any interest to applications that use popup-menu. Can you explain this point? IOW, what would you like to see, in terms of behavior _external_ to popup-menu? And a short recipe, starting from "emacs -Q" and showing the problem, would be most appreciated. Thanks.