unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ergus <spacibba@aol.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org, juri@linkov.net
Subject: Re: New Context Menu
Date: Sat, 21 Aug 2021 17:04:22 +0200	[thread overview]
Message-ID: <20210821150422.zoy3sig6cjnhyvjv@Ergus> (raw)
In-Reply-To: <83o89rz3tu.fsf@gnu.org>

On Sat, Aug 21, 2021 at 09:53:17AM +0300, Eli Zaretskii wrote:
>> Date: Sat, 21 Aug 2021 08:20:47 +0200
>> From: Ergus <spacibba@aol.com>
>> Cc: juri@linkov.net, emacs-devel@gnu.org
>>
>> 1) In a gui clicking (fast) mouse-X produces 2 events <down-mouse-X> +
>> <mouse-X> and emacs translates them to <down-mouse-X> + <mouse-X> ->
>> <mouse-X> when they are fast enough.
>>
>> 2) In a gui, holding mouse-X produces 1 event <down-mouse-X> and after a
>> small delay emacs processes the event, so releasing the button after
>> that delay is seen as an independent event <mouse-X>. 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
>> <down-mouse-X> + <mouse-X> but emacs does not translate them; that means
>> that <down-mouse-X> is processed (shows the menu) and then <mouse-X> 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
>> <down-mouse-X> + <mouse-X> into <mouse-X> 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.).



  reply	other threads:[~2021-08-21 15:04 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210818120834.i3orh535tb2enpos.ref@Ergus>
2021-08-18 12:08 ` New Context Menu Ergus
2021-08-18 12:26   ` Eli Zaretskii
2021-08-18 12:43     ` Ergus
2021-08-18 13:30       ` Eli Zaretskii
2021-08-18 17:17         ` Ergus
2021-08-18 17:21           ` Eli Zaretskii
2021-08-18 17:32             ` Ergus
2021-08-18 16:50       ` Eli Zaretskii
2021-08-18 18:10         ` Ergus
2021-08-18 18:17           ` Eli Zaretskii
2021-08-18 19:23             ` Ergus
2021-08-18 19:28               ` Eli Zaretskii
2021-08-18 19:53                 ` Ergus
2021-08-19  6:31                   ` Eli Zaretskii
2021-08-19  7:07                     ` Juri Linkov
2021-08-18 19:34               ` Eli Zaretskii
2021-08-18 18:58         ` Juri Linkov
2021-08-18 19:12           ` Eli Zaretskii
2021-08-19  7:05             ` Juri Linkov
2021-08-19  7:51               ` Eli Zaretskii
2021-08-20  7:13                 ` Juri Linkov
2021-08-20 11:26                   ` Eli Zaretskii
2021-08-20 11:41                     ` Eli Zaretskii
2021-08-20 16:44                       ` Juri Linkov
2021-08-20 12:26                     ` Ergus
2021-08-20 12:36                       ` Eli Zaretskii
2021-08-20 12:59                         ` Ergus
2021-08-20 13:03                         ` Ergus
2021-08-20 13:34                           ` Eli Zaretskii
2021-08-20 17:36                             ` Ergus
2021-08-20 18:05                               ` Eli Zaretskii
2021-08-20 18:08                                 ` Ergus
2021-08-20 19:07                                   ` Eli Zaretskii
2021-08-21  6:20                                     ` Ergus
2021-08-21  6:53                                       ` Eli Zaretskii
2021-08-21 15:04                                         ` Ergus [this message]
2021-08-20 18:15                                 ` Ergus
2021-08-20 23:15                                   ` Michael Welsh Duggan
2021-08-18 14:04   ` Jean-Christophe Helary
2021-08-18 16:38     ` Iñigo Serna
2021-08-19  0:38       ` Jean-Christophe Helary
2021-08-19  7:08         ` Juri Linkov
2021-08-19 14:22           ` Jean-Christophe Helary
2021-08-19  7:01   ` Juri Linkov
2021-08-19  8:03     ` Eli Zaretskii
2021-08-19 14:11       ` Ergus
2021-08-19 15:48         ` Eli Zaretskii
2021-08-19 16:34           ` Yuri Khan
2021-08-20  7:14       ` Juri Linkov
2021-08-20 11:29         ` Eli Zaretskii
2021-08-20 16:49           ` Juri Linkov
2021-08-20 18:01             ` Eli Zaretskii
2021-08-23  7:33               ` Juri Linkov
2021-08-23 11:36                 ` Eli Zaretskii
2021-08-23 16:04                   ` Juri Linkov
2021-08-23 16:35                     ` Eli Zaretskii
2021-08-23 17:42                       ` Juri Linkov
2021-08-23 18:02                         ` Ergus
2021-08-24  6:35                           ` Juri Linkov
2021-08-24  8:00                             ` Ergus
2021-08-24 11:44                               ` Yuri Khan
2021-08-24 16:05                                 ` Ergus
2021-08-24 19:41                                   ` Yuri Khan
2021-08-24 20:48                                     ` Ergus
2021-08-19 13:57     ` Ergus
2021-08-20  7:24       ` Juri Linkov
2021-08-20 12:21         ` Ergus
2021-08-20 16:41           ` Juri Linkov
2021-08-21  4:33             ` Ergus via Emacs development discussions.
2021-08-22  8:56               ` Juri Linkov
2021-08-27  6:21   ` New Context Menu and mouse-1 Juri Linkov
2021-08-27  6:55     ` Eli Zaretskii
2021-08-27 17:03       ` Juri Linkov
2021-08-27 22:01         ` Stefan Monnier
2021-08-28 18:52           ` Juri Linkov
2021-08-29 16:53           ` Juri Linkov
2021-08-30  7:22             ` Juri Linkov
2021-08-30 12:54               ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210821150422.zoy3sig6cjnhyvjv@Ergus \
    --to=spacibba@aol.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).