Subject: Re: bug#3468: drag and drop text

From: Cecilio Pardo <[email-masked]>
Date: Thu, 24 Oct 2024 10:46:12 +0200

On 24/10/2024 10:16, Eli Zaretskii wrote:
>> On 24/10/2024 9:37, Eli Zaretskii wrote:
>>> I guess I'm missing some higher-level understanding of how this work,
>>> because I don't think I understand why you needed to add a special
>>> message WM_EMACS_DRAGOVER for this.  Can you explain?
>>
>> I could reuse WM_EMACS_DROP, maybe rename to WM_EMACS_DRAGDROP. Added a
>> new one just for clarity.
> 
> I don't mind a new message, I just didn't understand why it was
> needed.  What is the purpose of WM_EMACS_DROP, and how it differs from
> this new message?

We receive the drag or drop information in the functions
w32_drop_target_Drop and w32_drop_target_DragOver, which run on another 
thread. We need to notify that to the input thread, sending a message to 
the window. We use those to custom messages, WM_EMACS_DROP and 
WM_EMACS_DRAGDROP. One for the drop, the other for when the mouse moves 
over the window.
> 
>>> What are the reasons for removing save-excursion?
>>
>> dnd-handle-movement needs to move the point to apply
>> dnd-indicate-insertion-point-
> 
> Then maybe use save-excursion when dnd-handle-movement is NOT called?

Ok, I'll do that.