unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: rswgnu@gmail.com
Cc: Tak Kunihiro <homeros.misasa@gmail.com>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: Emacs 26: Code that fixes mouse-drag-and-drop-region to work across frames
Date: Wed, 1 Nov 2017 17:16:58 +0000	[thread overview]
Message-ID: <20171101171658.GB78963@breton.holly.idiocy.org> (raw)
In-Reply-To: <CA+OMD9iEouOGq8RXS9+yRkv1CGLDqumOo96tbQAdO6kpTaheZg@mail.gmail.com>

On Wed, Nov 01, 2017 at 11:24:44AM -0400, Robert Weiner wrote:
> ​Maybe it would be best if someone fixed the XSETFRAME macro in
> ​mouse-position so it works properly under the macOS window system so we
> could avoid any work arounds on this.  -- Bob
> 
> From mouse-position:
>     ;;    f = SELECTED_FRAME ();
>     ;;    XSETFRAME (lispy_dummy, f);
>     ;;  It seems like the XSETFRAME macro is not properly copying the value
> of f on initial frame selection under the macOS window system.

That’s not the problem. I’ve explained this to you before.

ns_mouse_position uses dpyinfo->last_mouse_frame, which is set in
mouseDown. MouseDown is *not called* on macOS for the first click,
instead the frame is selected.

This means, like other macOS applications, the first click in the
window JUST selects that window, it has no other effect.

The docstring for mouse-position says:

    Return a list (FRAME X . Y) giving the current mouse frame and
    position.

To my way of reading that, ‘current mouse frame’ != ‘current selected
frame’, it will be the last frame that a mouse action of some sort was
registered in.

On macOS that doesn’t include the first click in the frame as it’s not
registered as an input by Emacs.

Is this behaviour wrong? I don’t know, but it seems to match the
documentation.

I’m sure Martin suggested this before, but if you’re trying to
implement cross‐frame/window dragging, would it not be better to try
and use the standard implementation for each platform?
-- 
Alan Third



  reply	other threads:[~2017-11-01 17:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 16:27 Emacs 26: Code that fixes mouse-drag-and-drop-region to work across frames Robert Weiner
2017-10-12 16:42 ` Robert Weiner
2017-10-12 17:11   ` Robert Weiner
2017-10-13  9:57 ` Tak Kunihiro
2017-10-16 13:45   ` Robert Weiner
2017-10-16 14:13     ` Robert Weiner
2017-10-19  0:43       ` Tak Kunihiro
2017-10-26 22:07         ` Robert Weiner
2017-11-01  2:04           ` Tak Kunihiro
2017-11-01 15:24             ` Robert Weiner
2017-11-01 17:16               ` Alan Third [this message]
2017-11-01 20:18                 ` Robert Weiner
2017-11-01 20:41                   ` Robert Weiner
2017-11-02  9:51                     ` martin rudalics
2017-11-02 19:00                       ` Robert Weiner
2017-11-02 20:16                         ` martin rudalics

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=20171101171658.GB78963@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=emacs-devel@gnu.org \
    --cc=homeros.misasa@gmail.com \
    --cc=rswgnu@gmail.com \
    /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).