Skip to main content
Topic: [fb2k bug? WinAPI shenanigans?] Dragging problems (Read 486 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[fb2k bug? WinAPI shenanigans?] Dragging problems

@Peter:

Scenario :
1. select an item (e.g. in playlist)
2. start dragging it without leaving the window.

Resulting events:
- drag_enter
- drag_over
- WM_MOUSELEAVE
- drag_over
- ...

I'm not sure who and why generates WM_MOUSELEAVE and thus I don't know how to handle it properly. Any help would be greatly appreciated.

Re: [fb2k bug? WinAPI shenanigans?] Dragging problems

Reply #1
Just for clarification, your #2 refers to dragging it without leaving the playlist window, right?

Re: [fb2k bug? WinAPI shenanigans?] Dragging problems

Reply #2
Just for clarification, your #2 refers to dragging it without leaving the playlist window, right?
Without leaving the window that processes the messages (playlist in this example).

 

Re: [fb2k bug? WinAPI shenanigans?] Dragging problems

Reply #3
I've managed to recreate what you're seeing.

Explained by Raymond Chen in detail-
https://devblogs.microsoft.com/oldnewthing/20101206-00/
Basically looks like DoDragDrop()'s SetCapture() terminates TrackMouseEvent() tracking, gently telling you that the tracking was terminated sending a seemingly spurious WM_MOUSELEAVE.

Re: [fb2k bug? WinAPI shenanigans?] Dragging problems

Reply #4
Thanks! It seems your googling skills are better than mine =)
This article makes obvious what I have to do: invoke "mouse leave" handler just before starting drag operation - since DoDragDrop will either trigger `on_drag_enter` event or will trigger nothing at all (if you move your mouse outside of the window VERY quickly after starting the drag).

 
SimplePortal 1.0.0 RC1 © 2008-2019