From 131a57248b694d1cfedd9ef744207c1aba09aee3 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Fri, 8 Jun 2018 10:27:03 -0700 Subject: [PATCH 01/11] NLPacket local ID could be used uninitialized (according to valgrind) --- libraries/networking/src/NLPacket.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/networking/src/NLPacket.cpp b/libraries/networking/src/NLPacket.cpp index f946e97bf4..620e60945b 100644 --- a/libraries/networking/src/NLPacket.cpp +++ b/libraries/networking/src/NLPacket.cpp @@ -199,7 +199,9 @@ void NLPacket::readVersion() { } void NLPacket::readSourceID() { - if (!PacketTypeEnum::getNonSourcedPackets().contains(_type)) { + if (PacketTypeEnum::getNonSourcedPackets().contains(_type)) { + _sourceID = NULL_LOCAL_ID; + } else { _sourceID = sourceIDInHeader(*this); } } From e3c8895c8965e0128d002d12aef36aecedd0cdc8 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Fri, 8 Jun 2018 18:17:03 -0700 Subject: [PATCH 02/11] Take down DependencyManager upon restart --- assignment-client/src/scripts/EntityScriptServer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assignment-client/src/scripts/EntityScriptServer.cpp b/assignment-client/src/scripts/EntityScriptServer.cpp index eea8e8b470..5722cccf38 100644 --- a/assignment-client/src/scripts/EntityScriptServer.cpp +++ b/assignment-client/src/scripts/EntityScriptServer.cpp @@ -570,6 +570,8 @@ void EntityScriptServer::aboutToFinish() { entityScriptingInterface->setPacketSender(nullptr); } + DependencyManager::destroy(); + DependencyManager::get()->cleanup(); // cleanup the AudioInjectorManager (and any still running injectors) From 5ae79bcc5e4f4613b42629b9ca3a53e80dda8dd6 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Mon, 11 Jun 2018 13:05:42 -0700 Subject: [PATCH 03/11] Use weak_ptr for pointers back to parent --- libraries/entities/src/EntityTreeElement.cpp | 6 +++--- libraries/entities/src/EntityTreeElement.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/entities/src/EntityTreeElement.cpp b/libraries/entities/src/EntityTreeElement.cpp index cbcddfc57b..719c065522 100644 --- a/libraries/entities/src/EntityTreeElement.cpp +++ b/libraries/entities/src/EntityTreeElement.cpp @@ -33,7 +33,7 @@ EntityTreeElement::~EntityTreeElement() { OctreeElementPointer EntityTreeElement::createNewElement(unsigned char* octalCode) { auto newChild = EntityTreeElementPointer(new EntityTreeElement(octalCode)); - newChild->setTree(_myTree); + newChild->setTree(getTree()); return newChild; } @@ -44,7 +44,7 @@ void EntityTreeElement::init(unsigned char* octalCode) { OctreeElementPointer EntityTreeElement::addChildAtIndex(int index) { OctreeElementPointer newElement = OctreeElement::addChildAtIndex(index); - std::static_pointer_cast(newElement)->setTree(_myTree); + std::static_pointer_cast(newElement)->setTree(getTree()); return newElement; } @@ -475,7 +475,7 @@ bool EntityTreeElement::removeEntityItem(EntityItemPointer entity, bool deletion int EntityTreeElement::readElementDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args) { - return _myTree->readEntityDataFromBuffer(data, bytesLeftToRead, args); + return getTree()->readEntityDataFromBuffer(data, bytesLeftToRead, args); } void EntityTreeElement::addEntityItem(EntityItemPointer entity) { diff --git a/libraries/entities/src/EntityTreeElement.h b/libraries/entities/src/EntityTreeElement.h index 76e1e40812..f9f930a9fc 100644 --- a/libraries/entities/src/EntityTreeElement.h +++ b/libraries/entities/src/EntityTreeElement.h @@ -161,8 +161,8 @@ public: virtual uint16_t size() const; bool hasEntities() const { return size() > 0; } - void setTree(EntityTreePointer tree) { _myTree = tree; } - EntityTreePointer getTree() const { return _myTree; } + void setTree(EntityTreePointer tree) { _myTree.swap(std::weak_ptr(tree)); } + EntityTreePointer getTree() const { return _myTree.lock(); } void addEntityItem(EntityItemPointer entity); @@ -234,7 +234,7 @@ public: protected: virtual void init(unsigned char * octalCode) override; - EntityTreePointer _myTree; + std::weak_ptr _myTree; EntityItems _entityItems; }; From 99a8ecc6db9865d63278e0a59f29f607ffb1d2f8 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Mon, 11 Jun 2018 13:52:44 -0700 Subject: [PATCH 04/11] Break simulation/entity-tree cycle --- assignment-client/src/entities/EntityTreeHeadlessViewer.cpp | 3 +++ libraries/entities/src/EntityTreeElement.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/assignment-client/src/entities/EntityTreeHeadlessViewer.cpp b/assignment-client/src/entities/EntityTreeHeadlessViewer.cpp index 81c42cda1e..3649cf1129 100644 --- a/assignment-client/src/entities/EntityTreeHeadlessViewer.cpp +++ b/assignment-client/src/entities/EntityTreeHeadlessViewer.cpp @@ -17,6 +17,9 @@ EntityTreeHeadlessViewer::EntityTreeHeadlessViewer() } EntityTreeHeadlessViewer::~EntityTreeHeadlessViewer() { + if (_simulation) { + _simulation->setEntityTree(nullptr); // Break shared_ptr cycle. + } } void EntityTreeHeadlessViewer::init() { diff --git a/libraries/entities/src/EntityTreeElement.h b/libraries/entities/src/EntityTreeElement.h index f9f930a9fc..023e908e2c 100644 --- a/libraries/entities/src/EntityTreeElement.h +++ b/libraries/entities/src/EntityTreeElement.h @@ -161,7 +161,7 @@ public: virtual uint16_t size() const; bool hasEntities() const { return size() > 0; } - void setTree(EntityTreePointer tree) { _myTree.swap(std::weak_ptr(tree)); } + void setTree(EntityTreePointer tree) { _myTree = std::weak_ptr(tree); } EntityTreePointer getTree() const { return _myTree.lock(); } void addEntityItem(EntityItemPointer entity); From 11129edddefec6d2bf70368b5cf23c1d2a376891 Mon Sep 17 00:00:00 2001 From: vladest Date: Tue, 12 Jun 2018 18:48:41 +0200 Subject: [PATCH 05/11] Remove extra textfield fro address ber input --- .../qml/hifi/tablet/TabletAddressDialog.qml | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml index 08f86770e6..9a472de046 100644 --- a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml +++ b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml @@ -89,6 +89,7 @@ StackView { property bool keyboardEnabled: false property bool punctuationMode: false + property bool keyboardRaised: false width: parent.width height: parent.height @@ -210,6 +211,8 @@ StackView { QQC2.TextField { id: addressLine + + focus: true width: addressLineContainer.width - addressLineContainer.anchors.leftMargin - addressLineContainer.anchors.rightMargin; anchors { left: addressLineContainer.left; @@ -236,24 +239,20 @@ StackView { color: hifi.colors.text background: Item {} - QQC2.Label { - T.TextField { - id: control + } - padding: 6 // numbers taken from Qt\5.9.2\Src\qtquickcontrols2\src\imports\controls\TextField.qml - leftPadding: padding + 4 - } + QQC2.Label { + font: addressLine.font - font: parent.font + x: addressLine.x + y: addressLine.y + leftPadding: addressLine.leftPadding + topPadding: addressLine.topPadding - x: control.leftPadding - y: control.topPadding - - text: parent.placeholderText2 - verticalAlignment: "AlignVCenter" - color: 'gray' - visible: parent.text === '' - } + text: addressLine.placeholderText2 + verticalAlignment: "AlignVCenter" + color: 'gray' + visible: addressLine.text === '' } Rectangle { From 9ae3411abea821b5743e91dff30b02e86eb3dfa8 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Tue, 12 Jun 2018 12:32:27 -0700 Subject: [PATCH 06/11] Have ~OctreeProcessor break cycle instead of using weak pointers --- libraries/entities/src/EntityTreeElement.cpp | 6 +++--- libraries/entities/src/EntityTreeElement.h | 6 +++--- libraries/octree/src/OctreeProcessor.cpp | 9 +++------ libraries/octree/src/OctreeProcessor.h | 3 +-- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/libraries/entities/src/EntityTreeElement.cpp b/libraries/entities/src/EntityTreeElement.cpp index 719c065522..cbcddfc57b 100644 --- a/libraries/entities/src/EntityTreeElement.cpp +++ b/libraries/entities/src/EntityTreeElement.cpp @@ -33,7 +33,7 @@ EntityTreeElement::~EntityTreeElement() { OctreeElementPointer EntityTreeElement::createNewElement(unsigned char* octalCode) { auto newChild = EntityTreeElementPointer(new EntityTreeElement(octalCode)); - newChild->setTree(getTree()); + newChild->setTree(_myTree); return newChild; } @@ -44,7 +44,7 @@ void EntityTreeElement::init(unsigned char* octalCode) { OctreeElementPointer EntityTreeElement::addChildAtIndex(int index) { OctreeElementPointer newElement = OctreeElement::addChildAtIndex(index); - std::static_pointer_cast(newElement)->setTree(getTree()); + std::static_pointer_cast(newElement)->setTree(_myTree); return newElement; } @@ -475,7 +475,7 @@ bool EntityTreeElement::removeEntityItem(EntityItemPointer entity, bool deletion int EntityTreeElement::readElementDataFromBuffer(const unsigned char* data, int bytesLeftToRead, ReadBitstreamToTreeParams& args) { - return getTree()->readEntityDataFromBuffer(data, bytesLeftToRead, args); + return _myTree->readEntityDataFromBuffer(data, bytesLeftToRead, args); } void EntityTreeElement::addEntityItem(EntityItemPointer entity) { diff --git a/libraries/entities/src/EntityTreeElement.h b/libraries/entities/src/EntityTreeElement.h index 023e908e2c..76e1e40812 100644 --- a/libraries/entities/src/EntityTreeElement.h +++ b/libraries/entities/src/EntityTreeElement.h @@ -161,8 +161,8 @@ public: virtual uint16_t size() const; bool hasEntities() const { return size() > 0; } - void setTree(EntityTreePointer tree) { _myTree = std::weak_ptr(tree); } - EntityTreePointer getTree() const { return _myTree.lock(); } + void setTree(EntityTreePointer tree) { _myTree = tree; } + EntityTreePointer getTree() const { return _myTree; } void addEntityItem(EntityItemPointer entity); @@ -234,7 +234,7 @@ public: protected: virtual void init(unsigned char * octalCode) override; - std::weak_ptr _myTree; + EntityTreePointer _myTree; EntityItems _entityItems; }; diff --git a/libraries/octree/src/OctreeProcessor.cpp b/libraries/octree/src/OctreeProcessor.cpp index db78e985e6..beaac1198c 100644 --- a/libraries/octree/src/OctreeProcessor.cpp +++ b/libraries/octree/src/OctreeProcessor.cpp @@ -20,12 +20,6 @@ #include "OctreeLogging.h" -OctreeProcessor::OctreeProcessor() : - _tree(NULL), - _managedTree(false) -{ -} - void OctreeProcessor::init() { if (!_tree) { _tree = createTree(); @@ -34,6 +28,9 @@ void OctreeProcessor::init() { } OctreeProcessor::~OctreeProcessor() { + if (_tree) { + _tree->eraseAllOctreeElements(false); + } } void OctreeProcessor::setTree(OctreePointer newTree) { diff --git a/libraries/octree/src/OctreeProcessor.h b/libraries/octree/src/OctreeProcessor.h index 25e280abca..325b33cd15 100644 --- a/libraries/octree/src/OctreeProcessor.h +++ b/libraries/octree/src/OctreeProcessor.h @@ -28,7 +28,6 @@ class OctreeProcessor : public QObject, public QEnableSharedFromThis { Q_OBJECT public: - OctreeProcessor(); virtual ~OctreeProcessor(); virtual char getMyNodeType() const = 0; @@ -61,7 +60,7 @@ protected: virtual OctreePointer createTree() = 0; OctreePointer _tree; - bool _managedTree; + bool _managedTree { false }; SimpleMovingAverage _elementsPerPacket; SimpleMovingAverage _entitiesPerPacket; From 010309ba312a1c572a0908ba9793f91f9042d092 Mon Sep 17 00:00:00 2001 From: vladest Date: Wed, 13 Jun 2018 14:51:29 +0200 Subject: [PATCH 07/11] Add focus change logging. Switch off all focus hacks --- interface/resources/qml/desktop/Desktop.qml | 6 +++--- interface/src/Application.cpp | 2 +- libraries/ui/src/OffscreenUi.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interface/resources/qml/desktop/Desktop.qml b/interface/resources/qml/desktop/Desktop.qml index a1b89e1529..4c1d337124 100644 --- a/interface/resources/qml/desktop/Desktop.qml +++ b/interface/resources/qml/desktop/Desktop.qml @@ -225,12 +225,12 @@ FocusScope { } Component.onCompleted: { - //offscreenWindow.activeFocusItemChanged.connect(onWindowFocusChanged); - focusHack.start(); + offscreenWindow.activeFocusItemChanged.connect(onWindowFocusChanged); + //focusHack.start(); } function onWindowFocusChanged() { - //console.log("Focus item is " + offscreenWindow.activeFocusItem); + console.log("Focus item is " + offscreenWindow.activeFocusItem); // FIXME this needs more testing before it can go into production // and I already cant produce any way to have a modal dialog lose focus diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index acdcdef2cf..5902f2bc9b 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3985,7 +3985,7 @@ void Application::mousePressEvent(QMouseEvent* event) { // hence, we should defocus all of the offscreen UI windows, in order to allow // keyboard shortcuts not to be swallowed by them. In particular, WebEngineViews // will consume all keyboard events. - offscreenUi->unfocusWindows(); + //offscreenUi->unfocusWindows(); auto eventPosition = getApplicationCompositor().getMouseEventPosition(event); QPointF transformedPos = offscreenUi->mapToVirtualScreen(eventPosition); diff --git a/libraries/ui/src/OffscreenUi.cpp b/libraries/ui/src/OffscreenUi.cpp index 25f0652496..62671e7c37 100644 --- a/libraries/ui/src/OffscreenUi.cpp +++ b/libraries/ui/src/OffscreenUi.cpp @@ -679,7 +679,7 @@ void OffscreenUi::createDesktop(const QUrl& url) { menuInitializer(_vrMenu); } - new KeyboardFocusHack(); + //new KeyboardFocusHack(); connect(_desktop, SIGNAL(showDesktop()), this, SIGNAL(showDesktop())); }); } From 27906bcdc84e5d1884542f1b9c0b0bcfd72ffcac Mon Sep 17 00:00:00 2001 From: vladest Date: Fri, 29 Jun 2018 21:16:14 +0200 Subject: [PATCH 08/11] Turn on focus hacks again --- interface/resources/qml/desktop/Desktop.qml | 6 +++--- interface/src/Application.cpp | 2 +- libraries/ui/src/OffscreenUi.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/interface/resources/qml/desktop/Desktop.qml b/interface/resources/qml/desktop/Desktop.qml index 4c1d337124..a1b89e1529 100644 --- a/interface/resources/qml/desktop/Desktop.qml +++ b/interface/resources/qml/desktop/Desktop.qml @@ -225,12 +225,12 @@ FocusScope { } Component.onCompleted: { - offscreenWindow.activeFocusItemChanged.connect(onWindowFocusChanged); - //focusHack.start(); + //offscreenWindow.activeFocusItemChanged.connect(onWindowFocusChanged); + focusHack.start(); } function onWindowFocusChanged() { - console.log("Focus item is " + offscreenWindow.activeFocusItem); + //console.log("Focus item is " + offscreenWindow.activeFocusItem); // FIXME this needs more testing before it can go into production // and I already cant produce any way to have a modal dialog lose focus diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 813a0ad818..a60d72073c 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3992,7 +3992,7 @@ void Application::mousePressEvent(QMouseEvent* event) { // hence, we should defocus all of the offscreen UI windows, in order to allow // keyboard shortcuts not to be swallowed by them. In particular, WebEngineViews // will consume all keyboard events. - //offscreenUi->unfocusWindows(); + offscreenUi->unfocusWindows(); auto eventPosition = getApplicationCompositor().getMouseEventPosition(event); QPointF transformedPos = offscreenUi->mapToVirtualScreen(eventPosition); diff --git a/libraries/ui/src/OffscreenUi.cpp b/libraries/ui/src/OffscreenUi.cpp index 62671e7c37..25f0652496 100644 --- a/libraries/ui/src/OffscreenUi.cpp +++ b/libraries/ui/src/OffscreenUi.cpp @@ -679,7 +679,7 @@ void OffscreenUi::createDesktop(const QUrl& url) { menuInitializer(_vrMenu); } - //new KeyboardFocusHack(); + new KeyboardFocusHack(); connect(_desktop, SIGNAL(showDesktop()), this, SIGNAL(showDesktop())); }); } From 09b21d3c4dfd7f64968e68c63d4002a42eefd5d0 Mon Sep 17 00:00:00 2001 From: Nex-Pro Date: Thu, 5 Jul 2018 17:04:36 +0100 Subject: [PATCH 09/11] Update BUILD_WIN.md Added dot backslash to avoid error in windows powershell at line 42. (worked for me) --- BUILD_WIN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD_WIN.md b/BUILD_WIN.md index 5836d5bfb5..90d2995e7d 100644 --- a/BUILD_WIN.md +++ b/BUILD_WIN.md @@ -39,7 +39,7 @@ Go to `Control Panel > System > Advanced System Settings > Environment Variables ### Step 6. Installing OpenSSL via vcpkg - * In the vcpkg directory, install the 64 bit OpenSSL package with the command `vcpkg install openssl:x64-windows` + * In the vcpkg directory, install the 64 bit OpenSSL package with the command `.\vcpkg install openssl:x64-windows` * Once the build completes you should have a file `ssl.h` in `${VCPKG_ROOT}/installed/x64-windows/include/openssl` ### Step 7. Running CMake to Generate Build Files From b2e02e20ccf675d2359267b4fa2b122613137be1 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Thu, 5 Jul 2018 11:47:10 -0700 Subject: [PATCH 10/11] Fix inaccurate delta rotation axis --- libraries/physics/src/CharacterController.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/physics/src/CharacterController.cpp b/libraries/physics/src/CharacterController.cpp index 64eda975cf..bb076c89f2 100755 --- a/libraries/physics/src/CharacterController.cpp +++ b/libraries/physics/src/CharacterController.cpp @@ -269,7 +269,8 @@ void CharacterController::playerStep(btCollisionWorld* collisionWorld, btScalar } btQuaternion deltaRot = desiredRot * startRot.inverse(); float angularSpeed = deltaRot.getAngle() / _followTimeRemaining; - btQuaternion angularDisplacement = btQuaternion(deltaRot.getAxis(), angularSpeed * dt); + glm::vec3 rotationAxis = glm::normalize(glm::axis(bulletToGLM(deltaRot))); // deltaRot.getAxis() is inaccurate + btQuaternion angularDisplacement = btQuaternion(glmToBullet(rotationAxis), angularSpeed * dt); btQuaternion endRot = angularDisplacement * startRot; // in order to accumulate displacement of avatar position, we need to take _shapeLocalOffset into account. From b4b0131065193e152050e0ca8afa454536d08f46 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 5 Jul 2018 14:33:21 -0700 Subject: [PATCH 11/11] grab correct commit hash for conflicting PR --- cmake/macros/SetPackagingParameters.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 2c8443d510..c40691c632 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -90,7 +90,7 @@ macro(SET_PACKAGING_PARAMETERS) # for the second parent of HEAD (not HEAD) since that is the # SHA of the commit merged to master for the build if (PR_BUILD) - set(_GIT_LOG_FORMAT "%p") + set(_GIT_LOG_FORMAT "%p %h") else () set(_GIT_LOG_FORMAT "%h") endif ()