From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: New Context Menu Date: Sat, 21 Aug 2021 17:04:22 +0200 Message-ID: <20210821150422.zoy3sig6cjnhyvjv@Ergus> References: <20210820122605.bewzngxm3w73yuif@Ergus> <834kbk1eem.fsf@gnu.org> <20210820130304.7dv3umwlvrnngaxw@Ergus> <8335r41bqn.fsf@gnu.org> <20210820173637.efw6y7zl4j7dbgif@Ergus> <83wnogyost.fsf@gnu.org> <20210820180805.hozyplizjgbw5voc@Ergus> <83v940ylxu.fsf@gnu.org> <20210821062047.djoaxquzelrbbnch@Ergus> <83o89rz3tu.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12168"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 21 17:06:04 2021 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 1mHSZP-0002pU-CA for ged-emacs-devel@m.gmane-mx.org; Sat, 21 Aug 2021 17:06:03 +0200 Original-Received: from localhost ([::1]:35044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHSZN-0001tj-H9 for ged-emacs-devel@m.gmane-mx.org; Sat, 21 Aug 2021 11:06:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHSYF-0001Dx-If for emacs-devel@gnu.org; Sat, 21 Aug 2021 11:04:51 -0400 Original-Received: from sonic316-11.consmr.mail.bf2.yahoo.com ([74.6.130.121]:44149) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mHSYC-0000TL-RU for emacs-devel@gnu.org; Sat, 21 Aug 2021 11:04:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1629558287; bh=4RG71AqktaxjIweRwLXM/WZIwD/8X8oSKrhkQ0hXNvk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=R4+IGJSHZaQW6KPCHGaKWxc1q2TSm70pPbPgNujHxdjeAbZWweJqMC1eMaQ2mkSSnZEWgctZsJqj9evoRJXZHXG5NNqeCop85m0iwSPV14wVEdf9mcrjxliSOS8sqIQKfdZ9bVswHI7fXkvQmpd8lzKiMvC5IDtXvXm9r3yC4S2mDyU4p2Eg+zpZpt1RJO4SXjumX4KTNyHV6+GFXMuRhwcD4rsZ3GKoQdpW0sqWqOct2GU+ktJf9+vM9L1pklzbhsIIptjnHvN0sBh9B4u3ZrsqOEsNhzMBLJkbw4LsLGUJ8AzrzihNHJqBxylBYZLmxwFTEHBSdsRFqbpqJahiRw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1629558287; bh=R8wtblXdC3S+hKblUDCFA7WO/81aAS1jWasKNU+Zfj0=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=R+Sz9g4vJrSCvykTaML+tVzgCdJiWnJ9Nf8LkUCpYKUncEDwfwQ+FhFcpuQUE/J7tqdYqjkLBNdx9DbOPZGareWMSQuGxkG6MpYeiI/dbF6jD1zHAuTD5SnSjp6PVpn/TtuVVjfF2jCrwlrQ6bij1C8tNQ/AAww90HqrgolaZC3vKxH+34mqyM65e6g42ZdDKT2hfNllrs0LMu6pXojxV2yy1cCB94tqya4Mj8/nBS4GezYCRJJxlbuh0CwrKGdntIp3RgaPC1Od12fde5BczbW+unqZdlnddjY57EXjjhOEVrhmvZQ7LWP9iPStCi4qLXLa+mRlWbxact2Ie3svKg== X-YMail-OSG: lvU7DyEVM1luNhuMtWlaj0of0EWt_xe0QuyK3uPI5Ee9DeRL5gfaqh2guiDvNNM i_Fx2yJssuIpMxnBO.ZAE2vZkv7RGasrx.Zbvwaszw5eLtzsuyOEc0yt94UwKFpxBSS9aWNNvUA8 1DksMUl_5kGykCauQERR_ufbDYNStwyxuIp_Io_u3YzbZDWpBmWTHgYnXWpQeix9z_NVrF2yxy1e VChQ98ak4tge9BMgExGxAGZnch1qJFLaMcPaz4OovECPZ1BYTuk4V03TWnYGp39gs95eLLF2ZFhP ibFHVBqJaQY8YOWJyKy_UmqIGM7OhtNWzEe.VvHrCjIsPCVFR7Kl6z162TWMVTJOuGwFppb4G1wa ZbbRJBXPCqhrGJyvCZOub2u.wDYIOlg5cpGbNQl.Gv2Uixj4c7GRZCS8OnidvQTlVH2_GH4Y4JSs E3THNaHcXgkEIzES05.GV9w2SrgDdwHOxv_i4S8_eq19Qhw_2ezhhb0bmdQGMipWpQt9X4ufsvj1 r6uIEBmrMnrdZ6NWSn1.fryBQ0_N2E0JqwXc_1ONin5X3HJ9SJov_Lw8p325x53jQ8lhl5SD2TKC FDX.Eye0XhkxLqhYi26ohxujMsSMwR294TwU6I4PmqfD3wHD3jgt77jTsX0M5LHvYpfax6ogqGbq .noifWRX1QyqZOebGWynGgEAgQ4mP7k.Bpg5nW0iEMexh_EPRlKP6.lnMjCurGVE8TFK034PVNJl WeZIM.brLptrlT0BiUyRdcvrbI850rfxugTNrE3T_66BDFrB0FMJLaZ_M0ltpNy3m10B_PNfFEf2 KghInYK7GXPtJDCoQpSIEI7XMWQV2FGp22YypMWgLS X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.bf2.yahoo.com with HTTP; Sat, 21 Aug 2021 15:04:47 +0000 Original-Received: by kubenode521.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 7874f94611d6a8ec64dfd46e4a1f32a4; Sat, 21 Aug 2021 15:04:45 +0000 (UTC) Content-Disposition: inline In-Reply-To: <83o89rz3tu.fsf@gnu.org> X-Mailer: WebService/1.1.18850 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.130.121; envelope-from=spacibba@aol.com; helo=sonic316-11.consmr.mail.bf2.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, RCVD_IN_MSPIKE_H2=-0.001, 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.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:272796 Archived-At: On Sat, Aug 21, 2021 at 09:53:17AM +0300, Eli Zaretskii wrote: >> Date: Sat, 21 Aug 2021 08:20:47 +0200 >> From: Ergus >> Cc: juri@linkov.net, emacs-devel@gnu.org >> >> 1) In a gui clicking (fast) mouse-X produces 2 events + >> and emacs translates them to + -> >> when they are fast enough. >> >> 2) In a gui, holding mouse-X produces 1 event and after a >> small delay emacs processes the event, so releasing the button after >> that delay is seen as an independent event . In this case there >> are two events and they are not merged as in 1. >> >> 3) In xterm, clicking (fast) mouse-X produces 2 events as well >> + but emacs does not translate them; that means >> that is processed (shows the menu) and then is >> also processes (hides the menu and selects). >> >> 4) In xterm, holding mouse-X and the releasing after a while is exactly >> the same as 3). >> >> So as I said before, in xterm emacs does not use such a delay on tui, it >> needs to be added or somehow provide a criteria to translate >> + into when it is done fast enough. > >And why are these differences a problem? > This is why the menu disappears in tty but stays in gui with a click. That's it. >You may be unaware of the terrible complexity and the hoops we jump >through to display menus on TTY frames, and to process mouse events on >such frames in general, but I can assure you those complexities are >real. It is a small surprise that given that, there are differences >in how these are presented to Emacs. > I am aware about how xterm events are passed to the application; but not about the complexity emacs adds to it. Juri used down-mouse-X events because in gui right click provided both behaviors out of the box depending on the delay between the events. But on tty we have only the "old" X11 one because it ignores the delay. I don't know if such delay is something emacs handles internally or relies in some external gtx/gui feature? In ncurses there is the "mouseinterval" function; but probably emacs uses something like select right? xterm emits 2 events (what I used to call down/up events some emails ago there is not something like "click" or "mouse" event AFAIK), but is not aware of delays between them. But emacs follows more the X11 set of events: "down-mouse" and "mouse" (where a "mouse" event is actually a down+up events within a delay) Then the problem may be that emacs assumes the "up-mouse" event as mouse-event which should work fine in most of the cases, but not when both ("down-mouse" and "mouse" events) perform actions because it will be impossible to emit a "mouse" event without a previous "down-mouse" So there are two options here: 1) A proper fix for this: make xterm events behave as gui. So add a delay to translate the two events into one; if emacs handles this internally it may be possible... probably it does because it also recognizes double-clicks.... 2) Do a workaround: add a custom to bind context-menu to down-mouse-3 or mouse-3 so the xterm user will have one experience or the other (but not both as Juri liked.).