From 8c512efd277cbf6c04c1c2e0fde4fb77f85d34d0 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 24 Dec 2013 08:05:55 +0000 Subject: [PATCH] Fix problem with wrong popup menu in SMESH module when "keyboard-free" navigation mode is switched on --- src/SVTK/SVTK_RenderWindowInteractor.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/SVTK/SVTK_RenderWindowInteractor.cxx b/src/SVTK/SVTK_RenderWindowInteractor.cxx index 6301ece1d..c7b9f5efc 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.cxx +++ b/src/SVTK/SVTK_RenderWindowInteractor.cxx @@ -57,6 +57,10 @@ static bool GENERATE_SUIT_EVENTS = true; static bool FOCUS_UNDER_MOUSE = false; +// workaround about the bug in vtkImplicitPlaneWidget class +// that eats mouse button release event +// causing clipping plane preview in SMESH sticking up +#define Fix_Of_vtkImplicitPlaneWidget_bug /*! Constructor @@ -293,17 +297,19 @@ QVTK_RenderWindowInteractor else if( event->button() & Qt::MidButton ) GetDevice()->MiddleButtonReleaseEvent(); else if( event->button() & Qt::RightButton ) { - #ifndef Fix_Of_vtkImplicitPlaneWidget_bug +#if defined(Fix_Of_vtkImplicitPlaneWidget_bug) GetDevice()->SetEventInformationFlipY( -99999, -99999, event->modifiers() & Qt::ControlModifier, event->modifiers() & Qt::ShiftModifier); + bool blocked = blockSignals( true ); GetDevice()->LeftButtonPressEvent(); GetDevice()->LeftButtonReleaseEvent(); + blockSignals( blocked ); GetDevice()->SetEventInformationFlipY(event->x(), event->y(), event->modifiers() & Qt::ControlModifier, event->modifiers() & Qt::ShiftModifier); - #endif +#endif GetDevice()->RightButtonReleaseEvent(); } } -- 2.39.2