Problems with WM_DROPFILES

John Found johnfound at asm32.info
Thu Oct 6 02:28:14 CDT 2016


After some talks and hints in the chat (thanks, puk, tbodt, nsivov!) I was able to fix the problem at least partially. 

The problem is that WINE uses WindowFromPoint to detect the drop target. 

WindowFromPoint uses WM_NCHITTEST to test the window and does not return windows returning HTTRANSPARENT.

This way, these windows (tab controls for example) can not be drop targets at all.

On the other hand, testing my code in Windows, I noticed, that it does not send WM_NCHITTEST at all and the "transparent" children are properly detected as a drop target.

It is a big question why Windows does not send WM_NCHITTEST. It is documented behavior in the cases when WindowFromPoint is called from another thread. 

So, what is the thread that control the drag and drop operations? In the case of WINE it 
is obviously the same thread as the window creator (as long as it sends WM_NCHITTEST). 

In the case of Windows - it can be simply another thread, or drag/drop operation does not use WindowFromPoint.

Any ideas about fixing all this mess? Writing own WindowFromPoint especially for the drag&drop operations?



On Wed, 5 Oct 2016 11:57:11 +0300
John Found <johnfound at asm32.info> wrote:

> I just realized, that in WINE, my windows receive WM_DROPFILES only if they are
> top level windows. All children windows never accept WM_DROPFILES, regardless of
> the presence of WS_EX_ACCEPTFILES or calling DragAcceptFiles() for this child window.
> 
> In Windows everything works OK and the children correctly receive WM_DROPFILES message.
> 
> Is it a bug in WINE, or something OS/WM dependent?
> 
> How to fix it? Is it a good idea, for example, to accept the message in the main window and dispatch it to the respective children windows (by using DragQueryPoint) - this approach should work both in WINE and Windows.
> 
> WINE v1.9.19 
> XFCE4 window manager.
> 
> -- 
> http://fresh.flatassembler.net
> http://asm32.info
> John Found <johnfound at asm32.info>
> 
> 


-- 
http://fresh.flatassembler.net
http://asm32.info
John Found <johnfound at asm32.info>



More information about the wine-devel mailing list