On 04/18/2019 11:39 AM, John Found wrote:
On Thu, 18 Apr 2019 09:47:17 -0500 Zebediah Figura z.figura12@gmail.com wrote:
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.)
Well, I don't know. I always expected that WindowFromPoint will return the top level window. And GetChildWindowFromPointEx will return only the children from the first level. Both in Windows and in WINE.
BTW, MSDN for ChildWindowFromPointEx says: "Determines which, if any, of the child windows belonging to the specified parent window contains the specified point. The function can ignore invisible, disabled, and transparent child windows. The search is restricted to immediate child windows. **Grandchildren and deeper descendants are not searched.**"
So, IMHO you are wrong and the implementation in WINE is correct. And the tests that pass are probably not for the children from the upper levels.
Really? I'm looking at this test right here:
https://source.winehq.org/git/wine.git/blob/refs/heads/master:/dlls/user32/tests/win.c#l9398
And the implementation here:
https://source.winehq.org/git/wine.git/blob/refs/heads/master:/dlls/user32/winpos.c#l289
and
https://source.winehq.org/git/wine.git/blob/refs/heads/master:/server/window.c#l2223
That seems to pretty clearly show that WindowFromPoint() will return a child window at the given point. Both in Windows and in Wine. Not a matter of opinion, really.
Maybe the tests or the implementation are incomplete, but then we should fix that, since it seems otherwise clear that WindowFromPoint() should be returning the deepest child.