emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs 26: Code that fixes mouse-drag-and-drop-region to work across


From: Alan Third
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
User-agent: Mutt/1.9.1 (2017-09-22)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]