[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

Re: [XaraXtreme-dev] Problem in wxWidgets 2.6.3...



Gerry,

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:

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...

Easy workaround, use wxXtra/cwfrompoint (i.e.
wxGetChildWindowFromPoint() ) instead, and apply your fix there. See
the file for parameters but it's very easy to convert over.

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.

It is not patched on 2.6 or 2.7 HEAD.

Can I suggest though that you do this instead for safety:

--- 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->GetParent() && !win->IsTopLevel())
     {
         pos = win->GetParent()->ClientToScreen(pos);
     }


This could do with being applied to the build server.

Can we consider not applying the patch and using the above workaround
instead? (in the interest of minimizing local patches which will
be required by everyone who builds). There is no disadvantage to
using a (fixed) wxChildWindowAtPoint and we can fix it locally.

Alex