There appears to be a problem in wxFindWindowAtPoint that is causing our drags to go wrong when galleries or dialogs are open. If you open XaraLX and move the window to the right half of the screen and then open the colour gallery and put it in the top left corner about half the screen height and then try dragging a colour (either from the gallery or from the colour line) around in the view you will see that there is a patch the size of the colour gallery in the top left of our mainframe into which you cant drop the colour.
Adding a little bit of code to the status line that dumps out the classname and window title confirms that wxFindWindowAtPointer thinks it is over the colour gallery when it isn’t. A similar thing happens with the align dialog.
This obviously looks like an issue with GetRect (and GetPosition) returning screen coords for “top level” windows. On investigation it appears that the bug is here:
--- src/common/utilscmn.cpp 2006-05-19 09:31:14.000000000 +0100
+++ src/common/utilscmn.cpp 2006-05-19 09:25:32.000000000 +0100
@@ -904,7 +904,7 @@
wxPoint pos = win->GetPosition();
wxSize sz = win->GetSize();
- if (win->GetParent())
+ if (!win->IsTopLevel())
pos = win->GetParent()->ClientToScreen(pos);
The problem with this is that all frames and dialogs are considered “top level” regardless of whether they have a parent. Checking IsTopLevel instead appears to fix it...
Can someone who has the latest wx source please check if this has been fixed already? If not, I’ll post it to the patch tracker.
This could do with being applied to the build server.