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

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

Well, I agree that we shouldn't be relying on patches to wx and I agree
that wxXtra/cwfrompoint.cpp also needs the same fix.

However it isn't trivial to switch to using it instead as it requires a
base wxWindow* whereas the standard wxFindWindowAtPoint(er) scans all of
the top level windows or are you suggesting that I write our own
wxFindWindowAtPoint(er) functions in xwXtra that do the top level window

There are several other calls to it (camview, ccolbar and dlgmgr) that
will also suffer from this same problem and presumably there will be
other calls internal to wxWidgets that will suffer from it too.

I'll submit the patch with your suggested change (I'm pretty certain
that by definition, if a window returns FALSE from IsTopLevel then it
must have a parent but no real harm in being safe).


-----Original Message-----
From: owner-dev@xxxxxxxxxxxxxxxx [mailto:owner-dev@xxxxxxxxxxxxxxxx] On
Behalf Of Alex Bligh
Sent: 19 May 2006 11:22
To: dev@xxxxxxxxxxxxxx
Cc: Alex Bligh
Subject: Re: [XaraXtreme-dev] Problem in wxWidgets 2.6.3...


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