Subject: bug#19988: 25.0.50; Drag events ending in different frame

From: Eli Zaretskii <[email-masked]>
Date: Fri, 06 Mar 2015 16:13:35 +0200

> From: Tassilo Horn <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Fri, 06 Mar 2015 08:12:14 +0100
> 
>   3. When I drag into a different window on the right of the start
>      window which shows a different buffer than the start window, the
>      region (highlighting) freezes as soon as I leave the start window.
>      When I release the mouse button, the region suddenly becomes
>      start-position to top of the buffer.

What happens when you release the mouse button depend on which line in
the original window you were.  If you were on the first line, then
mouse-drag-track (which see) tries to scroll the display, and as
result you end up with the above effect.

>   4. Doing the same as in 3. but dragging to the window on the left,
>      when releasing the mouse button the region suddenly becomes start
>      position to "somewhere above the end of the marked region which
>      froze when leaving the start window", i.e., the region-end jumps
>      up.  Sometimes even higher than the region-start, sometimes below
>      it.  Sorry, I don't see any system here...

Look at mouse-drag-track, and I think things will become clearer.  Not
sure if the logic there is entirely correct, I think it might "assume"
too much when the end event gives no usable position on another frame.

>   5. Dragging outside of the frame (which has only one window) freezes
>      the selected region as soon as the mouse leaves the frame.  It
>      doesn't matter if I leave to the left or to the right.  When I then
>      release the mouse button outside of the frame, the region vanishes
>      and the mark is set at the start position of the drag.
> 
> So it seems you get a different behavior in at least case 5 (i.e., your
> region doesn't vanish).

It does vanish when I release the mouse button.