On 4/18/19 6:37 AM, John Found wrote:
I don't think that's correct; the documentation states that WindowFromPoint() returns the deepest child, and we have tests to support this.
What documentation? MS documentation is pretty vague:
https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-wind...
It states only that: "Retrieves a handle to the window that contains the specified point." > In addition, the current implementation of drop target detection code uses exactly WindowFromPoint (see the patch - I have replaced this line) and it definitely does not detects the children windows at all.
I will attach a small test application that creates a parent window and 3 nested children, all of them has WS_EX_ACCEPTFILES set.
When you drop a file at some of the windows (the parent or some of the children) the static control displays what is the drop operation target.
So, in Linux, only the "Parent" is returned, regardless of the real drop target. In Windows and in Linux with the applied patch, the drop target is always the right child window.
Er, yes, that was my mistake, sorry. MSDN is not clear at all. However, the point remains, we have tests for this behaviour, and as far as I'm reading the server code it should be implemented correctly. If it's not working, then I would guess there's a bug elsewhere (or possibly there's some quirk here that the tests don't cover, but then we should find and identify that first.)