wxVTKRenderWindowInteractor mouse capturing logic breaks with multiple clicks
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
There's a problem in the mouse capturing logic of wxVTKRWI that you can trigger with the following steps (easy to test with e.g. the wxVTKRenderWindowInteractor.py in Wrapping/Python/vtk/wx itself)
- Press left mouse button to cause the object to rotate
- While keeping the left mouse button pressed, press the right button. This will activate "continuous rotation"
- Release both buttons
This will cause the mouse to remain captured to the render window. Even if you left click on the scene again, the rotation correctly stops, but the mouse remains captured.
It was very easy to fix this: instead of having a boolean flag _own_mouse for indicating whether it window has captured the mouse, make it a counter. So initialize it to zero, and when you CaptureMouse(), increase it by one and when you ReleaseMouse() , decrease it by one.