[vtkusers] wxVTKRenderWindow: magic --sync

Mathieu Malaterre Mathieu.Malaterre at creatis.insa-lyon.fr
Wed Apr 9 09:39:54 EDT 2003


Hi all,
    I swear I didn't hide anything in my pockets but on the contrary
I would be very gratfull to anyone that could find the trick. I also 
apologize for all the cross posting.

This is a **long** email. Please bear with me. I was in touch with Vadim 
Zeitlin about this problem but failed to produce a simple example that 
didn't make use of VTK. Basically VTK is a layer that abstract OpenGL stuff.

* Description of the problem;

    I am using wxVTKRenderWindow into my project and found a naughty
behavior when draging the mouse out of the VTK window and dropping the
mouse on top of let say the satus bar. While browsing the python source
code, I understood this came from a bug in wxGTK prior to 2.3.2. As I am
using wxGTK 2.4.0 I thought this bug was fixed.

So I modified the python source file:

line 71, I changed:
        WX_USE_X_CAPTURE = 0
into
        WX_USE_X_CAPTURE = 1
and I added a status bar to the main frame. You can download this
modfied version from:

http://www.creatis.insa-lyon.fr/~malaterre/wxVTKRenderWindowInteractor.py

Then you can start the script like this (don't forget '--sync' option):

$python wxVTKRenderWindowInteractor.py --sync

You'll see that everything is working properly. Even the drag and drop
on the status bar (for not convinced people you can turn back 
WX_USE_X_CAPTURE = 0 and see that the status bar makes users loose the 
mouse events).

---

Now comes the magic part. Start this script again *without* the --sync
option:

$python wxVTKRenderWindowInteractor.py

if you click *without* moving the mouse, everything should go smoothly.
But then, try again and drag the mouse to the status bar...
yeah you lost the mouse event! You need to kill this app from a ssh
session !

I haven't been able to reproduce this bug on wxGTK prior to 2.3.2. There
was a big change from 2.3.1 to 2.3.2 that's why it is a bit hard for me
to track down the modification that only deal with my problem.

---

As I don't believe anymore in magical stuff, I decide to hack down the
wxPython source and found that the '--sync' option was only there to
active an XSynchronize event. So I tried to modify the
vtkXOpenGLRenderWindow class.
I uncommented the XSynchronize (line 867), but this didn't make any 
change. Whereas the '--sync' was still working.
Any X11 guru comment on that ?


Version:
Linux RedHat 7.3
wxPython 2.4.0.7
python 2.2
gtk+-1.2.10-22
VTK 4.3 (fresh CVS)

thank you all for reading me,
mathieu
ps: If you've reach this far, you are a very patient guy !

-- 
Mathieu Malaterre
CREATIS
28 Avenue du Doyen LEPINE
B.P. Lyon-Montchat
69394 Lyon Cedex 03
http://www.creatis.insa-lyon.fr/~malaterre/








More information about the vtkusers mailing list