diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 9714ec051..4b2d5b410 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -1437,10 +1437,16 @@ void StdCmdToggleNavigation::activated(int iMsg) bool StdCmdToggleNavigation::isActive(void) { + //#0001087: Inventor Navigation continues with released Mouse Button + //This happens because 'Esc' is also used to close the task dialog. + //Add also new method 'isRedirectToSceneGraphEnabled' to explicitly + //check if this is allowed. + if (Gui::Control().activeDialog()) + return false; Gui::MDIView* view = Gui::getMainWindow()->activeWindow(); if (view && view->isDerivedFrom(Gui::View3DInventor::getClassTypeId())) { Gui::View3DInventorViewer* viewer = static_cast(view)->getViewer(); - return viewer->isEditing(); + return viewer->isEditing() && viewer->isRedirectToSceneGraphEnabled(); } return false; } diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 2d9328c26..f5dc4e8d3 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -138,7 +138,7 @@ SOQT_OBJECT_ABSTRACT_SOURCE(View3DInventorViewer); View3DInventorViewer::View3DInventorViewer (QWidget *parent, const char *name, SbBool embed, Type type, SbBool build) : inherited (parent, name, embed, type, build), editViewProvider(0),navigation(0), - editing(FALSE), redirected(FALSE) + editing(FALSE), redirected(FALSE), allowredir(FALSE) { Gui::Selection().Attach(this); diff --git a/src/Gui/View3DInventorViewer.h b/src/Gui/View3DInventorViewer.h index c53298a1f..072f2a0bd 100644 --- a/src/Gui/View3DInventorViewer.h +++ b/src/Gui/View3DInventorViewer.h @@ -182,6 +182,8 @@ public: void setEditingCursor (const QCursor& cursor); void setRedirectToSceneGraph(SbBool redirect) { this->redirected = redirect; } SbBool isRedirectedToSceneGraph() const { return this->redirected; } + void setRedirectToSceneGraphEnabled(SbBool enable) { this->allowredir = enable; } + SbBool isRedirectToSceneGraphEnabled(void) const { return this->allowredir; } //@} /** @name Pick actions */ @@ -311,6 +313,7 @@ private: SbBool editing; QCursor editCursor; SbBool redirected; + SbBool allowredir; void setCursorRepresentation(int mode); diff --git a/src/Mod/Inspection/Gui/Command.cpp b/src/Mod/Inspection/Gui/Command.cpp index 8176bdf40..75915160f 100644 --- a/src/Mod/Inspection/Gui/Command.cpp +++ b/src/Mod/Inspection/Gui/Command.cpp @@ -87,6 +87,7 @@ void CmdInspectElement::activated(int iMsg) if (view) { Gui::View3DInventorViewer* viewer = view->getViewer(); viewer->setEditing(true); + viewer->setRedirectToSceneGraphEnabled(true); viewer->setRedirectToSceneGraph(true); viewer->setEditingCursor(QCursor(Gui::BitmapFactory().pixmap("mesh_pipette"),4,29)); viewer->addEventCallback(SoButtonEvent::getClassTypeId(), diff --git a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp index dc6f246ed..1783b6380 100644 --- a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp +++ b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp @@ -436,6 +436,7 @@ void ViewProviderInspection::inspectCallback(void * ud, SoEventCallback * n) view->setEditing(false); view->getWidget()->setCursor(QCursor(Qt::ArrowCursor)); view->setRedirectToSceneGraph(false); + view->setRedirectToSceneGraphEnabled(false); view->removeEventCallback(SoButtonEvent::getClassTypeId(), inspectCallback); } }