From 97b6128dcd77af75a77dfe4c02d7ab19ec410af7 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 27 Dec 2012 12:29:44 +0100 Subject: [PATCH] 0000911: V0.13- Faces of Solid models cannot be selected when ALT-TAB is used to switch between applications --- src/Gui/BlenderNavigationStyle.cpp | 3 +++ src/Gui/CADNavigationStyle.cpp | 1 + src/Gui/InventorNavigationStyle.cpp | 3 +++ src/Gui/SoFCUnifiedSelection.cpp | 20 +------------------- src/Gui/SoFCUnifiedSelection.h | 3 --- src/Gui/TouchpadNavigationStyle.cpp | 3 +++ 6 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/Gui/BlenderNavigationStyle.cpp b/src/Gui/BlenderNavigationStyle.cpp index a33763596..2b782a19f 100644 --- a/src/Gui/BlenderNavigationStyle.cpp +++ b/src/Gui/BlenderNavigationStyle.cpp @@ -83,6 +83,9 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) // which influence the seek mode itself -- these are handled further // up the inheritance hierarchy. if (this->isSeekMode()) { return inherited::processSoEvent(ev); } + // Switch off viewing mode (Bug #0000911) + if (!this->isSeekMode() && this->isViewing()) + this->setViewing(false); // by default disable viewing mode to render the scene const SoType type(ev->getTypeId()); diff --git a/src/Gui/CADNavigationStyle.cpp b/src/Gui/CADNavigationStyle.cpp index b7aae8f48..0aded9a73 100644 --- a/src/Gui/CADNavigationStyle.cpp +++ b/src/Gui/CADNavigationStyle.cpp @@ -85,6 +85,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) // up the inheritance hierarchy. if (this->isSeekMode()) { return inherited::processSoEvent(ev); } #else + // Switch off viewing mode (Bug #0000911) if (!this->isSeekMode() && this->isViewing()) this->setViewing(false); // by default disable viewing mode to render the scene #endif diff --git a/src/Gui/InventorNavigationStyle.cpp b/src/Gui/InventorNavigationStyle.cpp index 2ebc53371..1f48dd4b1 100644 --- a/src/Gui/InventorNavigationStyle.cpp +++ b/src/Gui/InventorNavigationStyle.cpp @@ -83,6 +83,9 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) // which influence the seek mode itself -- these are handled further // up the inheritance hierarchy. if (this->isSeekMode()) { return inherited::processSoEvent(ev); } + // Switch off viewing mode (Bug #0000911) + if (!this->isSeekMode() && this->isViewing()) + this->setViewing(false); // by default disable viewing mode to render the scene const SoType type(ev->getTypeId()); diff --git a/src/Gui/SoFCUnifiedSelection.cpp b/src/Gui/SoFCUnifiedSelection.cpp index 77929a281..f8f42764b 100644 --- a/src/Gui/SoFCUnifiedSelection.cpp +++ b/src/Gui/SoFCUnifiedSelection.cpp @@ -105,8 +105,6 @@ SoFCUnifiedSelection::SoFCUnifiedSelection() : viewer(0) SO_NODE_SET_SF_ENUM_TYPE (highlightMode, HighlightModes); highlighted = FALSE; - bShift = FALSE; - bCtrl = FALSE; } /*! @@ -414,22 +412,6 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action) } } } - // key press events - else if (event->isOfType(SoKeyboardEvent ::getClassTypeId())) { - SoKeyboardEvent * const e = (SoKeyboardEvent *) event; - if (SoKeyboardEvent::isKeyPressEvent(e,SoKeyboardEvent::LEFT_SHIFT) || - SoKeyboardEvent::isKeyPressEvent(e,SoKeyboardEvent::RIGHT_SHIFT) ) - bShift = true; - if (SoKeyboardEvent::isKeyReleaseEvent(e,SoKeyboardEvent::LEFT_SHIFT) || - SoKeyboardEvent::isKeyReleaseEvent(e,SoKeyboardEvent::RIGHT_SHIFT) ) - bShift = false; - if (SoKeyboardEvent::isKeyPressEvent(e,SoKeyboardEvent::LEFT_CONTROL) || - SoKeyboardEvent::isKeyPressEvent(e,SoKeyboardEvent::RIGHT_CONTROL) ) - bCtrl = true; - if (SoKeyboardEvent::isKeyReleaseEvent(e,SoKeyboardEvent::LEFT_CONTROL) || - SoKeyboardEvent::isKeyReleaseEvent(e,SoKeyboardEvent::RIGHT_CONTROL) ) - bCtrl = false; - } // mouse press events for (de)selection else if (event->isOfType(SoMouseButtonEvent::getClassTypeId()) && selectionMode.getValue() == SoFCUnifiedSelection::ON) { @@ -449,7 +431,7 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action) std::string documentName = vpd->getObject()->getDocument()->getName(); std::string objectName = vpd->getObject()->getNameInDocument(); std::string subElementName = vpd->getElement(pp ? pp->getDetail() : 0); - if (bCtrl) { + if (event->wasCtrlDown()) { if (Gui::Selection().isSelected(documentName.c_str() ,objectName.c_str() ,subElementName.c_str())) { diff --git a/src/Gui/SoFCUnifiedSelection.h b/src/Gui/SoFCUnifiedSelection.h index 491c2d2c1..db6cf1183 100644 --- a/src/Gui/SoFCUnifiedSelection.h +++ b/src/Gui/SoFCUnifiedSelection.h @@ -107,9 +107,6 @@ private: SbBool highlighted; SoColorPacker colorpacker; - - SbBool bShift; - SbBool bCtrl; }; /** diff --git a/src/Gui/TouchpadNavigationStyle.cpp b/src/Gui/TouchpadNavigationStyle.cpp index 9eca5aafc..cef63a384 100644 --- a/src/Gui/TouchpadNavigationStyle.cpp +++ b/src/Gui/TouchpadNavigationStyle.cpp @@ -83,6 +83,9 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) // which influence the seek mode itself -- these are handled further // up the inheritance hierarchy. if (this->isSeekMode()) { return inherited::processSoEvent(ev); } + // Switch off viewing mode (Bug #0000911) + if (!this->isSeekMode() && this->isViewing()) + this->setViewing(false); // by default disable viewing mode to render the scene const SoType type(ev->getTypeId());