From 7017cf84376eea677b6ba352e7c9ded4eabdce19 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 12 Jun 2019 15:24:43 -0700 Subject: [PATCH 01/13] reinitialize winsock on silent domain checkin --- libraries/networking/src/udt/Socket.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index 9871935853..7fd697a674 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -76,6 +76,10 @@ void Socket::rebind() { void Socket::rebind(quint16 localPort) { _udpSocket.close(); +#ifdef WIN32 + WSAData ws; + WSAStartup(MAKEWORD(2, 2), &ws); +#endif bind(QHostAddress::AnyIPv4, localPort); } From def000749667e1723ae434bc70d3a3070ef0931e Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Thu, 13 Jun 2019 11:39:13 -0700 Subject: [PATCH 02/13] REfining the filter based on the COmputer model name and catching the 2 known problematic models --- libraries/platform/src/platform/Profiler.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/platform/src/platform/Profiler.cpp b/libraries/platform/src/platform/Profiler.cpp index bd8efb9097..1c0942f860 100644 --- a/libraries/platform/src/platform/Profiler.cpp +++ b/libraries/platform/src/platform/Profiler.cpp @@ -141,14 +141,14 @@ bool Profiler::isRenderMethodDeferredCapable() { // Macbook air 2018 are a problem - if ((computerModel.find("MacBookAir") != std::string::npos) && (gpuModel.find("Intel HD Graphics 6000") != std::string::npos)) { + if ((computerModel.find("MacBookAir7,2") != std::string::npos) && (gpuModel.find("Intel HD Graphics 6000") != std::string::npos)) { return false; } - // We know for fact that one INtel Iris is problematic, not enough info yet for sure - // if ((gpuModel.find("Intel Iris ....") != std::string::npos)) { - // return false; - //} + // We know for fact that the Mac BOok Pro 13 from Mid 2014 INtel Iris is problematic, + if ((computerModel.find("MacBookPro11,1") != std::string::npos) && (gpuModel.find("Intel Iris") != std::string::npos)) { + return false; + } return true; #elif defined(Q_OS_ANDROID) From 3d2b1dbf2bf2a3e310f22a132a86011d5f4cf1ce Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 13 Jun 2019 17:25:35 -0700 Subject: [PATCH 03/13] When missing domain checkins, drop packets not destined for DS --- libraries/networking/src/DomainHandler.cpp | 9 +++++++-- libraries/networking/src/LimitedNodeList.cpp | 7 +++++++ libraries/networking/src/LimitedNodeList.h | 4 ++++ libraries/networking/src/NodeList.cpp | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/libraries/networking/src/DomainHandler.cpp b/libraries/networking/src/DomainHandler.cpp index b442463ac8..5f8aceca35 100644 --- a/libraries/networking/src/DomainHandler.cpp +++ b/libraries/networking/src/DomainHandler.cpp @@ -566,9 +566,14 @@ bool DomainHandler::checkInPacketTimeout() { qCDebug(networking_ice) << "Silent domain checkins:" << _checkInPacketsSinceLastReply; } - if (_checkInPacketsSinceLastReply > MAX_SILENT_DOMAIN_SERVER_CHECK_INS) { + auto nodeList = DependencyManager::get(); - auto nodeList = DependencyManager::get(); + if(_checkInPacketsSinceLastReply > 2) { + qCDebug(networking_ice) << _checkInPacketsSinceLastReply << "seconds since last domain list request, squelching traffic"; + nodeList->setDropOutgoingNodeTraffic(true); + } + + if (_checkInPacketsSinceLastReply > MAX_SILENT_DOMAIN_SERVER_CHECK_INS) { // we haven't heard back from DS in MAX_SILENT_DOMAIN_SERVER_CHECK_INS // so emit our signal that says that diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index 9f4eb39013..6faaca219c 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -409,6 +409,13 @@ qint64 LimitedNodeList::sendUnreliablePacket(const NLPacket& packet, const HifiS Q_ASSERT_X(!packet.isReliable(), "LimitedNodeList::sendUnreliablePacket", "Trying to send a reliable packet unreliably."); + if(_dropOutgoingNodeTraffic) { + auto destinationNode = findNodeWithAddr(sockAddr); + if (!destinationNode.isNull() && (destinationNode->getType() != NodeType::DomainServer)) { + return ERROR_SENDING_PACKET_BYTES; + } + } + fillPacketHeader(packet, hmacAuth); return _nodeSocket.writePacket(packet, sockAddr); diff --git a/libraries/networking/src/LimitedNodeList.h b/libraries/networking/src/LimitedNodeList.h index bd5e6bd013..f9f6bf3b3e 100644 --- a/libraries/networking/src/LimitedNodeList.h +++ b/libraries/networking/src/LimitedNodeList.h @@ -335,6 +335,8 @@ public: float getInboundKbps() const { return _inboundKbps; } float getOutboundKbps() const { return _outboundKbps; } + void setDropOutgoingNodeTraffic(bool squelchOutgoingNodeTraffic) { _dropOutgoingNodeTraffic = squelchOutgoingNodeTraffic; } + const std::set SOLO_NODE_TYPES = { NodeType::AvatarMixer, NodeType::AudioMixer, @@ -493,6 +495,8 @@ private: int _outboundPPS { 0 }; float _inboundKbps { 0.0f }; float _outboundKbps { 0.0f }; + + bool _dropOutgoingNodeTraffic { false }; }; #endif // hifi_LimitedNodeList_h diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 86b33bbe20..39b8fa29a9 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -710,6 +710,7 @@ void NodeList::processDomainServerList(QSharedPointer message) // this is a packet from the domain server, reset the count of un-replied check-ins _domainHandler.clearPendingCheckins(); + setDropOutgoingNodeTraffic(false); // emit our signal so listeners know we just heard from the DS emit receivedDomainServerList(); From 5b6911efa46452b98de667cf18612729767df23d Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 14 Jun 2019 10:45:18 -0700 Subject: [PATCH 04/13] log username with "haven't heard from" messages remove rebind on silent domain checkin --- domain-server/src/DomainServer.cpp | 7 ++++++- libraries/networking/src/NodeList.cpp | 5 ----- libraries/networking/src/udt/Socket.cpp | 4 ---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 44887599d3..5dd98c2ae7 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1735,7 +1735,12 @@ void DomainServer::nodePingMonitor() { nodeList->eachNode([now](const SharedNodePointer& node) { quint64 lastHeard = now - node->getLastHeardMicrostamp(); if (lastHeard > 2 * USECS_PER_SECOND) { - qCDebug(domain_server) << "Haven't heard from " << node->getPublicSocket() << " in " << lastHeard / USECS_PER_MSEC << " msec"; + QString username; + DomainServerNodeData* nodeData = static_cast(node->getLinkedData()); + if(nodeData) { + username = nodeData->getUsername(); + } + qCDebug(domain_server) << "Haven't heard from " << node->getPublicSocket() << username << " in " << lastHeard / USECS_PER_MSEC << " msec"; } }); } diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 39b8fa29a9..b43f9f88e1 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -450,13 +450,8 @@ void NodeList::sendDomainServerCheckIn() { // Send duplicate check-ins in the exponentially increasing sequence 1, 1, 2, 4, ... static const int MAX_CHECKINS_TOGETHER = 20; - static const int REBIND_CHECKIN_COUNT = 2; int outstandingCheckins = _domainHandler.getCheckInPacketsSinceLastReply(); - if (outstandingCheckins > REBIND_CHECKIN_COUNT) { - _nodeSocket.rebind(); - } - int checkinCount = outstandingCheckins > 1 ? std::pow(2, outstandingCheckins - 2) : 1; checkinCount = std::min(checkinCount, MAX_CHECKINS_TOGETHER); for (int i = 1; i < checkinCount; ++i) { diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index a3e9a43503..fc6d2cbe2a 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -76,10 +76,6 @@ void Socket::rebind() { void Socket::rebind(quint16 localPort) { _udpSocket.close(); -#ifdef WIN32 - WSAData ws; - WSAStartup(MAKEWORD(2, 2), &ws); -#endif bind(QHostAddress::AnyIPv4, localPort); } From aff139f495b31055175391830ca7ce1af5c4b16c Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Fri, 14 Jun 2019 12:49:11 -0700 Subject: [PATCH 05/13] excluding any intel gpu from deferred on mac for the next few days --- libraries/platform/src/platform/Profiler.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/platform/src/platform/Profiler.cpp b/libraries/platform/src/platform/Profiler.cpp index 1c0942f860..1c055a5ec9 100644 --- a/libraries/platform/src/platform/Profiler.cpp +++ b/libraries/platform/src/platform/Profiler.cpp @@ -149,6 +149,11 @@ bool Profiler::isRenderMethodDeferredCapable() { if ((computerModel.find("MacBookPro11,1") != std::string::npos) && (gpuModel.find("Intel Iris") != std::string::npos)) { return false; } + + // TO avoid issues for the next few days, we are excluding all of intel chipset... + if ((gpuModel.find("Intel ") != std::string::npos)) { + return false; + } return true; #elif defined(Q_OS_ANDROID) From 1b31b8cff8066a1e102c18e1b9b6d669b44f7093 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 14 Jun 2019 13:23:33 -0700 Subject: [PATCH 06/13] CR fixes --- domain-server/src/DomainServer.cpp | 2 +- libraries/networking/src/DomainHandler.cpp | 4 +++- libraries/networking/src/LimitedNodeList.cpp | 7 +++++-- libraries/networking/src/NodeList.cpp | 11 ----------- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 5dd98c2ae7..358b05222c 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1737,7 +1737,7 @@ void DomainServer::nodePingMonitor() { if (lastHeard > 2 * USECS_PER_SECOND) { QString username; DomainServerNodeData* nodeData = static_cast(node->getLinkedData()); - if(nodeData) { + if (nodeData) { username = nodeData->getUsername(); } qCDebug(domain_server) << "Haven't heard from " << node->getPublicSocket() << username << " in " << lastHeard / USECS_PER_MSEC << " msec"; diff --git a/libraries/networking/src/DomainHandler.cpp b/libraries/networking/src/DomainHandler.cpp index 5f8aceca35..3512b02d11 100644 --- a/libraries/networking/src/DomainHandler.cpp +++ b/libraries/networking/src/DomainHandler.cpp @@ -559,6 +559,8 @@ void DomainHandler::processDomainServerConnectionDeniedPacket(QSharedPointer(); - if(_checkInPacketsSinceLastReply > 2) { + if (_checkInPacketsSinceLastReply > SILENT_DOMAIN_TRAFFIC_DROP_MIN) { qCDebug(networking_ice) << _checkInPacketsSinceLastReply << "seconds since last domain list request, squelching traffic"; nodeList->setDropOutgoingNodeTraffic(true); } diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index 6faaca219c..8fefe5820c 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -409,9 +409,12 @@ qint64 LimitedNodeList::sendUnreliablePacket(const NLPacket& packet, const HifiS Q_ASSERT_X(!packet.isReliable(), "LimitedNodeList::sendUnreliablePacket", "Trying to send a reliable packet unreliably."); - if(_dropOutgoingNodeTraffic) { + if (_dropOutgoingNodeTraffic) { auto destinationNode = findNodeWithAddr(sockAddr); - if (!destinationNode.isNull() && (destinationNode->getType() != NodeType::DomainServer)) { + + // findNodeWithAddr returns null for the address of the domain server + if (!destinationNode.isNull()) { + // This only suppresses individual unreliable packets, not unreliable packet lists return ERROR_SENDING_PACKET_BYTES; } } diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 7dd9ee21b7..3d367bc761 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -453,17 +453,6 @@ void NodeList::sendDomainServerCheckIn() { static const int MAX_CHECKINS_TOGETHER = 20; int outstandingCheckins = _domainHandler.getCheckInPacketsSinceLastReply(); - /* - static const int WARNING_CHECKIN_COUNT = 2; - if (outstandingCheckins > WARNING_CHECKIN_COUNT) { - // We may be headed for a disconnect, as we've written two DomainListRequests without getting anything back. - // In some cases, we've found that nothing is going out on the wire despite not getting any errors from - // sendPacket => writeDatagram, below. In at least some such cases, we've found that the DomainDisconnectRequest - // does go through, so let's at least try to mix it up with a different safe packet. - // TODO: send ICEPing, and later on tell the other nodes to shut up for a moment. - - }*/ - int checkinCount = outstandingCheckins > 1 ? std::pow(2, outstandingCheckins - 2) : 1; checkinCount = std::min(checkinCount, MAX_CHECKINS_TOGETHER); for (int i = 1; i < checkinCount; ++i) { From ce96ea5bf8039c074b36166868a4ed0f57803228 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 17 Jun 2019 11:20:42 -0700 Subject: [PATCH 07/13] more correct rebuild OtherAvatar detailed pickable shapes --- interface/src/avatar/AvatarManager.cpp | 31 +++++++++++-------- interface/src/avatar/AvatarManager.h | 4 ++- .../src/avatar/MyCharacterController.cpp | 8 ++--- interface/src/avatar/MyCharacterController.h | 1 - interface/src/avatar/OtherAvatar.cpp | 8 ++--- interface/src/avatar/OtherAvatar.h | 4 +-- 6 files changed, 31 insertions(+), 25 deletions(-) diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index efe3d59d90..c88a934acf 100755 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -435,7 +435,7 @@ DetailedMotionState* AvatarManager::createDetailedMotionState(OtherAvatarPointer return nullptr; } -void AvatarManager::rebuildAvatarPhysics(PhysicsEngine::Transaction& transaction, OtherAvatarPointer avatar) { +void AvatarManager::rebuildAvatarPhysics(PhysicsEngine::Transaction& transaction, const OtherAvatarPointer& avatar) { if (!avatar->_motionState) { avatar->_motionState = new AvatarMotionState(avatar, nullptr); } @@ -452,20 +452,24 @@ void AvatarManager::rebuildAvatarPhysics(PhysicsEngine::Transaction& transaction transaction.objectsToAdd.push_back(motionState); } motionState->clearIncomingDirtyFlags(); +} - // Rather than reconcile numbers of joints after change to model or LOD - // we blow away old detailedMotionStates and create anew all around. - +void AvatarManager::removeDetailedAvatarPhysics(PhysicsEngine::Transaction& transaction, const OtherAvatarPointer& avatar) { // delete old detailedMotionStates auto& detailedMotionStates = avatar->getDetailedMotionStates(); if (detailedMotionStates.size() != 0) { for (auto& detailedMotionState : detailedMotionStates) { transaction.objectsToRemove.push_back(detailedMotionState); } - avatar->resetDetailedMotionStates(); + avatar->forgetDetailedMotionStates(); } +} - // build new detailedMotionStates +void AvatarManager::rebuildDetailedAvatarPhysics(PhysicsEngine::Transaction& transaction, const OtherAvatarPointer& avatar) { + // Rather than reconcile numbers of joints after change to model or LOD + // we blow away old detailedMotionStates and create anew all around. + removeDetailedAvatarPhysics(transaction, avatar); + auto& detailedMotionStates = avatar->getDetailedMotionStates(); OtherAvatar::BodyLOD lod = avatar->getBodyLOD(); if (lod == OtherAvatar::BodyLOD::Sphere) { auto dMotionState = createDetailedMotionState(avatar, -1); @@ -483,24 +487,21 @@ void AvatarManager::rebuildAvatarPhysics(PhysicsEngine::Transaction& transaction } } } - avatar->_needsReinsertion = false; + avatar->_needsDetailedRebuild = false; } void AvatarManager::buildPhysicsTransaction(PhysicsEngine::Transaction& transaction) { _myAvatar->getCharacterController()->buildPhysicsTransaction(transaction); for (auto avatar : _otherAvatarsToChangeInPhysics) { bool isInPhysics = avatar->isInPhysicsSimulation(); - if (isInPhysics != avatar->shouldBeInPhysicsSimulation() || avatar->_needsReinsertion) { + if (isInPhysics != avatar->shouldBeInPhysicsSimulation()) { if (isInPhysics) { transaction.objectsToRemove.push_back(avatar->_motionState); avatar->_motionState = nullptr; - auto& detailedMotionStates = avatar->getDetailedMotionStates(); - for (auto& motionState : detailedMotionStates) { - transaction.objectsToRemove.push_back(motionState); - } - avatar->resetDetailedMotionStates(); + removeDetailedAvatarPhysics(transaction, avatar); } else { rebuildAvatarPhysics(transaction, avatar); + rebuildDetailedAvatarPhysics(transaction, avatar); } } else if (isInPhysics) { AvatarMotionState* motionState = avatar->_motionState; @@ -519,6 +520,10 @@ void AvatarManager::buildPhysicsTransaction(PhysicsEngine::Transaction& transact } motionState->clearIncomingDirtyFlags(); } + + if (avatar->_needsDetailedRebuild) { + rebuildDetailedAvatarPhysics(transaction, avatar); + } } } _otherAvatarsToChangeInPhysics.clear(); diff --git a/interface/src/avatar/AvatarManager.h b/interface/src/avatar/AvatarManager.h index db1bc125a4..ce23a80309 100644 --- a/interface/src/avatar/AvatarManager.h +++ b/interface/src/avatar/AvatarManager.h @@ -274,7 +274,9 @@ public slots: protected: AvatarSharedPointer addAvatar(const QUuid& sessionUUID, const QWeakPointer& mixerWeakPointer) override; DetailedMotionState* createDetailedMotionState(OtherAvatarPointer avatar, int32_t jointIndex); - void rebuildAvatarPhysics(PhysicsEngine::Transaction& transaction, OtherAvatarPointer avatar); + void rebuildAvatarPhysics(PhysicsEngine::Transaction& transaction, const OtherAvatarPointer& avatar); + void removeDetailedAvatarPhysics(PhysicsEngine::Transaction& transaction, const OtherAvatarPointer& avatar); + void rebuildDetailedAvatarPhysics(PhysicsEngine::Transaction& transaction, const OtherAvatarPointer& avatar); private: explicit AvatarManager(QObject* parent = 0); diff --git a/interface/src/avatar/MyCharacterController.cpp b/interface/src/avatar/MyCharacterController.cpp index aef1bcd668..2f59b70592 100755 --- a/interface/src/avatar/MyCharacterController.cpp +++ b/interface/src/avatar/MyCharacterController.cpp @@ -398,15 +398,13 @@ DetailedMotionState* MyCharacterController::createDetailedMotionStateForJoint(in } void MyCharacterController::clearDetailedMotionStates() { + // we don't actually clear the MotionStates here + // instead we twiddle some flags as a signal of what to do later _pendingFlags |= PENDING_FLAG_REMOVE_DETAILED_FROM_SIMULATION; // We make sure we don't add them again _pendingFlags &= ~PENDING_FLAG_ADD_DETAILED_TO_SIMULATION; } -void MyCharacterController::resetDetailedMotionStates() { - _detailedMotionStates.clear(); -} - void MyCharacterController::buildPhysicsTransaction(PhysicsEngine::Transaction& transaction) { for (size_t i = 0; i < _detailedMotionStates.size(); i++) { _detailedMotionStates[i]->forceActive(); @@ -416,6 +414,8 @@ void MyCharacterController::buildPhysicsTransaction(PhysicsEngine::Transaction& for (size_t i = 0; i < _detailedMotionStates.size(); i++) { transaction.objectsToRemove.push_back(_detailedMotionStates[i]); } + // NOTE: the DetailedMotionStates are deleted after being added to PhysicsEngine::Transaction::_objectsToRemove + // See AvatarManager::handleProcessedPhysicsTransaction() _detailedMotionStates.clear(); } if (_pendingFlags & PENDING_FLAG_ADD_DETAILED_TO_SIMULATION) { diff --git a/interface/src/avatar/MyCharacterController.h b/interface/src/avatar/MyCharacterController.h index 0b64f66850..7ddcf94f67 100644 --- a/interface/src/avatar/MyCharacterController.h +++ b/interface/src/avatar/MyCharacterController.h @@ -48,7 +48,6 @@ public: DetailedMotionState* createDetailedMotionStateForJoint(int32_t jointIndex); std::vector& getDetailedMotionStates() { return _detailedMotionStates; } void clearDetailedMotionStates(); - void resetDetailedMotionStates(); void buildPhysicsTransaction(PhysicsEngine::Transaction& transaction); diff --git a/interface/src/avatar/OtherAvatar.cpp b/interface/src/avatar/OtherAvatar.cpp index 6f83c61cd6..a6e2d6a998 100755 --- a/interface/src/avatar/OtherAvatar.cpp +++ b/interface/src/avatar/OtherAvatar.cpp @@ -177,7 +177,7 @@ const btCollisionShape* OtherAvatar::createCollisionShape(int32_t jointIndex, bo return ObjectMotionState::getShapeManager()->getShape(shapeInfo); } -void OtherAvatar::resetDetailedMotionStates() { +void OtherAvatar::forgetDetailedMotionStates() { // NOTE: the DetailedMotionStates are deleted after being added to PhysicsEngine::Transaction::_objectsToRemove // See AvatarManager::handleProcessedPhysicsTransaction() _detailedMotionStates.clear(); @@ -209,7 +209,7 @@ void OtherAvatar::computeShapeLOD() { if (newLOD != _bodyLOD) { _bodyLOD = newLOD; if (isInPhysicsSimulation()) { - _needsReinsertion = true; + _needsDetailedRebuild = true; } } } @@ -224,14 +224,14 @@ bool OtherAvatar::shouldBeInPhysicsSimulation() const { bool OtherAvatar::needsPhysicsUpdate() const { constexpr uint32_t FLAGS_OF_INTEREST = Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS | Simulation::DIRTY_POSITION | Simulation::DIRTY_COLLISION_GROUP; - return (_needsReinsertion || (_motionState && (bool)(_motionState->getIncomingDirtyFlags() & FLAGS_OF_INTEREST))); + return (_needsDetailedRebuild || (_motionState && (bool)(_motionState->getIncomingDirtyFlags() & FLAGS_OF_INTEREST))); } void OtherAvatar::rebuildCollisionShape() { if (_motionState) { // do not actually rebuild here, instead flag for later _motionState->addDirtyFlags(Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS); - _needsReinsertion = true; + _needsDetailedRebuild = true; } } diff --git a/interface/src/avatar/OtherAvatar.h b/interface/src/avatar/OtherAvatar.h index 498971d6ee..cfe0c8332d 100644 --- a/interface/src/avatar/OtherAvatar.h +++ b/interface/src/avatar/OtherAvatar.h @@ -54,7 +54,7 @@ public: const btCollisionShape* createCollisionShape(int32_t jointIndex, bool& isBound, std::vector& boundJoints); std::vector& getDetailedMotionStates() { return _detailedMotionStates; } - void resetDetailedMotionStates(); + void forgetDetailedMotionStates(); BodyLOD getBodyLOD() { return _bodyLOD; } void computeShapeLOD(); @@ -90,7 +90,7 @@ protected: int32_t _spaceIndex { -1 }; uint8_t _workloadRegion { workload::Region::INVALID }; BodyLOD _bodyLOD { BodyLOD::Sphere }; - bool _needsReinsertion { false }; + bool _needsDetailedRebuild { false }; }; using OtherAvatarPointer = std::shared_ptr; From 11fb7e5b633e7c156292e535f8a2b374bd7e082f Mon Sep 17 00:00:00 2001 From: dante ruiz Date: Mon, 17 Jun 2019 12:16:54 -0700 Subject: [PATCH 08/13] fixing typo --- launchers/darwin/src/ProcessScreen.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launchers/darwin/src/ProcessScreen.m b/launchers/darwin/src/ProcessScreen.m index fb1de799da..4aeb8abda1 100644 --- a/launchers/darwin/src/ProcessScreen.m +++ b/launchers/darwin/src/ProcessScreen.m @@ -25,7 +25,7 @@ break; case CHECKING_UPDATE: [self.boldStatus setStringValue:@"Getting updates..."]; - [self.smallStatus setStringValue:@"We're getting the lastest and greatest for you, one sec."]; + [self.smallStatus setStringValue:@"We're getting the latest and greatest for you, one sec."]; break; case RUNNING_INTERFACE_AFTER_UPDATE: [self.boldStatus setStringValue:@"You're good to go!"]; From 1d2ed1985f098dd5d8953ef1b6a82edcaba720a3 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 17 Jun 2019 12:35:45 -0700 Subject: [PATCH 09/13] DEV-142 & DEV-140: Scrollbars in Your Profile and Settings --- interface/resources/qml/InteractiveWindow.qml | 14 +++- .../hifi/simplifiedUI/avatarApp/AvatarApp.qml | 5 ++ .../simplifiedUI/settingsApp/SettingsApp.qml | 30 ++++---- .../simplifiedUI/settingsApp/audio/Audio.qml | 24 +++++- .../hifi/simplifiedUI/settingsApp/dev/Dev.qml | 24 +++++- .../settingsApp/general/General.qml | 75 ++++++++++++------- .../hifi/simplifiedUI/settingsApp/vr/VR.qml | 24 +++++- .../SimplifiedConstants.qml | 8 ++ .../simplifiedControls/VerticalScrollBar.qml | 51 +++++++++++++ 9 files changed, 200 insertions(+), 55 deletions(-) create mode 100644 interface/resources/qml/hifi/simplifiedUI/simplifiedControls/VerticalScrollBar.qml diff --git a/interface/resources/qml/InteractiveWindow.qml b/interface/resources/qml/InteractiveWindow.qml index da1e9ec2bf..df3475ea7b 100644 --- a/interface/resources/qml/InteractiveWindow.qml +++ b/interface/resources/qml/InteractiveWindow.qml @@ -58,6 +58,7 @@ Windows.Window { } QmlSurface.load(source, contentHolder, function(newObject) { dynamicContent = newObject; + updateInteractiveWindowSizeForMode(); if (dynamicContent && dynamicContent.anchors) { dynamicContent.anchors.fill = contentHolder; } @@ -81,10 +82,12 @@ Windows.Window { } function updateInteractiveWindowSizeForMode() { - if (presentationMode === Desktop.PresentationMode.VIRTUAL) { - width = interactiveWindowSize.width; - height = interactiveWindowSize.height; - } else if (presentationMode === Desktop.PresentationMode.NATIVE && nativeWindow) { + root.width = interactiveWindowSize.width; + root.height = interactiveWindowSize.height; + contentHolder.width = interactiveWindowSize.width; + contentHolder.height = interactiveWindowSize.height; + + if (presentationMode === Desktop.PresentationMode.NATIVE && nativeWindow) { nativeWindow.width = interactiveWindowSize.width; nativeWindow.height = interactiveWindowSize.height; } @@ -134,6 +137,9 @@ Windows.Window { Window { id: root; + width: interactiveWindowSize.width + height: interactiveWindowSize.height + Rectangle { color: hifi.colors.baseGray anchors.fill: parent diff --git a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml index ef9a3cbe24..d52dd3f3d7 100644 --- a/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml +++ b/interface/resources/qml/hifi/simplifiedUI/avatarApp/AvatarApp.qml @@ -10,6 +10,7 @@ import QtQuick 2.10 import "../simplifiedConstants" as SimplifiedConstants +import "../simplifiedControls" as SimplifiedControls import "./components" as AvatarAppComponents import stylesUit 1.0 as HifiStylesUit import TabletScriptingInterface 1.0 @@ -245,6 +246,10 @@ Rectangle { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter } + + SimplifiedControls.VerticalScrollBar { + parent: inventoryContentsList + } } diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/SettingsApp.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/SettingsApp.qml index 60703a8062..adb8344902 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/SettingsApp.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/SettingsApp.qml @@ -9,7 +9,9 @@ // import QtQuick 2.10 +import QtQuick.Controls 2.3 import "../simplifiedConstants" as SimplifiedConstants +import "../simplifiedControls" as SimplifiedControls import stylesUit 1.0 as HifiStylesUit import "./audio" as AudioSettings import "./general" as GeneralSettings @@ -129,9 +131,7 @@ Rectangle { id: tabViewContainers anchors.top: tabContainer.bottom anchors.left: parent.left - anchors.leftMargin: 26 anchors.right: parent.right - anchors.rightMargin: 26 anchors.bottom: parent.bottom @@ -162,24 +162,20 @@ Rectangle { visible: activeTabView === "devTabView" anchors.fill: parent } - } - Image { - source: { - if (root.activeTabView === "generalTabView") { - "images/accent1.svg" - } else if (root.activeTabView === "audioTabView") { - "images/accent2.svg" - } else if (root.activeTabView === "vrTabView") { - "images/accent3.svg" - } else { - "images/accent3.svg" + SimplifiedControls.VerticalScrollBar { + parent: { + if (activeTabView === "generalTabView") { + generalTabViewContainer + } else if (activeTabView === "audioTabView") { + audioTabViewContainer + } else if (activeTabView === "vrTabView") { + vrTabViewContainer + } else if (activeTabView === "devTabView") { + devTabViewContainer + } } } - anchors.right: parent.right - anchors.top: tabContainer.bottom - width: 106 - height: 200 } diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml index 4dc5e973fc..68a8fa49da 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml @@ -19,8 +19,6 @@ Flickable { id: root contentWidth: parent.width contentHeight: audioColumnLayout.height - topMargin: 24 - bottomMargin: 24 clip: true function changePeakValuesEnabled(enabled) { @@ -33,7 +31,7 @@ Flickable { AudioScriptingInterface.devices.input.peakValuesEnabled = visible; if (visible) { root.contentX = 0; - root.contentY = -root.topMargin; + root.contentY = 0; AudioScriptingInterface.devices.input.peakValuesEnabledChanged.connect(changePeakValuesEnabled); } else { AudioScriptingInterface.devices.input.peakValuesEnabledChanged.disconnect(changePeakValuesEnabled); @@ -45,16 +43,35 @@ Flickable { id: simplifiedUI } + + Image { + id: accent + source: "../images/accent2.svg" + anchors.left: parent.left + anchors.top: parent.top + width: 83 + height: 156 + transform: Scale { + xScale: -1 + origin.x: accent.width / 2 + origin.y: accent.height / 2 + } + } + + ColumnLayout { id: audioColumnLayout anchors.left: parent.left + anchors.leftMargin: 26 anchors.right: parent.right + anchors.rightMargin: 26 anchors.top: parent.top spacing: simplifiedUI.margins.settings.spacingBetweenSettings ColumnLayout { id: volumeControlsContainer Layout.preferredWidth: parent.width + Layout.topMargin: 24 spacing: 0 HifiStylesUit.GraphikSemiBold { @@ -289,6 +306,7 @@ Flickable { ColumnLayout { id: outputDeviceContainer Layout.preferredWidth: parent.width + Layout.bottomMargin: 24 spacing: 0 HifiStylesUit.GraphikSemiBold { diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/dev/Dev.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/dev/Dev.qml index a8c0a8f158..fe623e5d78 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/dev/Dev.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/dev/Dev.qml @@ -19,14 +19,12 @@ Flickable { id: root contentWidth: parent.width contentHeight: devColumnLayout.height - topMargin: 24 - bottomMargin: 24 clip: true onVisibleChanged: { if (visible) { root.contentX = 0; - root.contentY = -root.topMargin; + root.contentY = 0; } } @@ -35,16 +33,36 @@ Flickable { id: simplifiedUI } + + Image { + id: accent + source: "../images/accent3.svg" + anchors.left: parent.left + anchors.top: parent.top + width: 83 + height: 156 + transform: Scale { + xScale: -1 + origin.x: accent.width / 2 + origin.y: accent.height / 2 + } + } + + ColumnLayout { id: devColumnLayout anchors.left: parent.left + anchors.leftMargin: 26 anchors.right: parent.right + anchors.rightMargin: 26 anchors.top: parent.top spacing: simplifiedUI.margins.settings.spacingBetweenSettings ColumnLayout { id: uiControlsContainer Layout.preferredWidth: parent.width + Layout.topMargin: 24 + Layout.bottomMargin: 24 spacing: 0 HifiStylesUit.GraphikSemiBold { diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml index f56d0f33bd..af7e9ba4ae 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml @@ -9,6 +9,7 @@ // import QtQuick 2.10 +import QtQuick.Controls 2.3 import "../../simplifiedConstants" as SimplifiedConstants import "../../simplifiedControls" as SimplifiedControls import stylesUit 1.0 as HifiStylesUit @@ -20,8 +21,6 @@ Flickable { id: root contentWidth: parent.width contentHeight: generalColumnLayout.height - topMargin: 24 - bottomMargin: 24 clip: true onAvatarNametagModeChanged: { @@ -31,7 +30,7 @@ Flickable { onVisibleChanged: { if (visible) { root.contentX = 0; - root.contentY = -root.topMargin; + root.contentY = 0; } } @@ -39,16 +38,35 @@ Flickable { id: simplifiedUI } + + Image { + id: accent + source: "../images/accent1.svg" + anchors.left: parent.left + anchors.top: parent.top + width: 83 + height: 156 + transform: Scale { + xScale: -1 + origin.x: accent.width / 2 + origin.y: accent.height / 2 + } + } + + ColumnLayout { id: generalColumnLayout anchors.left: parent.left + anchors.leftMargin: 26 anchors.right: parent.right + anchors.rightMargin: 26 anchors.top: parent.top spacing: simplifiedUI.margins.settings.spacingBetweenSettings ColumnLayout { id: avatarNameTagsContainer Layout.preferredWidth: parent.width + Layout.topMargin: 24 spacing: 0 HifiStylesUit.GraphikSemiBold { @@ -193,29 +211,36 @@ Flickable { } } - HifiStylesUit.GraphikRegular { - id: logoutText - text: (AccountServices.username === "Unknown user" ? "Log In" : "Logout " + AccountServices.username) - wrapMode: Text.Wrap - width: paintedWidth - height: paintedHeight - size: 14 - color: simplifiedUI.colors.text.lightBlue + ColumnLayout { + id: logoutContainer + Layout.preferredWidth: parent.width + Layout.bottomMargin: 24 + spacing: 0 - MouseArea { - anchors.fill: parent - hoverEnabled: true - onEntered: { - parent.color = simplifiedUI.colors.text.lightBlueHover; - } - onExited: { - parent.color = simplifiedUI.colors.text.lightBlue; - } - onClicked: { - if (Account.loggedIn) { - AccountServices.logOut(); - } else { - DialogsManager.showLoginDialog(); + HifiStylesUit.GraphikRegular { + id: logoutText + text: (AccountServices.username === "Unknown user" ? "Log In" : "Logout " + AccountServices.username) + wrapMode: Text.Wrap + width: paintedWidth + height: paintedHeight + size: 14 + color: simplifiedUI.colors.text.lightBlue + + MouseArea { + anchors.fill: parent + hoverEnabled: true + onEntered: { + parent.color = simplifiedUI.colors.text.lightBlueHover; + } + onExited: { + parent.color = simplifiedUI.colors.text.lightBlue; + } + onClicked: { + if (Account.loggedIn) { + AccountServices.logOut(); + } else { + DialogsManager.showLoginDialog(); + } } } } diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml index 9f5ed3ff8f..c1dc3888e2 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml @@ -19,8 +19,6 @@ Flickable { id: root contentWidth: parent.width contentHeight: vrColumnLayout.height - topMargin: 24 - bottomMargin: 24 clip: true function changePeakValuesEnabled(enabled) { @@ -33,7 +31,7 @@ Flickable { AudioScriptingInterface.devices.input.peakValuesEnabled = visible; if (visible) { root.contentX = 0; - root.contentY = -root.topMargin; + root.contentY = 0; AudioScriptingInterface.devices.input.peakValuesEnabledChanged.connect(changePeakValuesEnabled); } else { AudioScriptingInterface.devices.input.peakValuesEnabledChanged.disconnect(changePeakValuesEnabled); @@ -45,16 +43,35 @@ Flickable { id: simplifiedUI } + + Image { + id: accent + source: "../images/accent3.svg" + anchors.left: parent.left + anchors.top: parent.top + width: 83 + height: 156 + transform: Scale { + xScale: -1 + origin.x: accent.width / 2 + origin.y: accent.height / 2 + } + } + + ColumnLayout { id: vrColumnLayout anchors.left: parent.left + anchors.leftMargin: 26 anchors.right: parent.right + anchors.rightMargin: 26 anchors.top: parent.top spacing: simplifiedUI.margins.settings.spacingBetweenSettings ColumnLayout { id: controlsContainer Layout.preferredWidth: parent.width + Layout.topMargin: 24 spacing: 0 HifiStylesUit.GraphikSemiBold { @@ -278,6 +295,7 @@ Flickable { ColumnLayout { id: outputDeviceContainer Layout.preferredWidth: parent.width + Layout.bottomMargin: 24 spacing: 0 HifiStylesUit.GraphikSemiBold { diff --git a/interface/resources/qml/hifi/simplifiedUI/simplifiedConstants/SimplifiedConstants.qml b/interface/resources/qml/hifi/simplifiedUI/simplifiedConstants/SimplifiedConstants.qml index 5aa94d798e..fb09a7ae1d 100644 --- a/interface/resources/qml/hifi/simplifiedUI/simplifiedConstants/SimplifiedConstants.qml +++ b/interface/resources/qml/hifi/simplifiedUI/simplifiedConstants/SimplifiedConstants.qml @@ -144,6 +144,10 @@ QtObject { readonly property color hover: "#FFFFFF" readonly property color focus: "#FFFFFF" } + readonly property QtObject scrollBar: QtObject { + readonly property color background: "#474747" + readonly property color contentItem: "#0198CB" + } } readonly property color darkSeparator: "#595959" @@ -219,6 +223,10 @@ QtObject { readonly property QtObject textField: QtObject { readonly property int editPencilPadding: 6 } + readonly property QtObject scrollBar: QtObject { + readonly property int backgroundWidth: 9 + readonly property int contentItemWidth: 7 + } } } diff --git a/interface/resources/qml/hifi/simplifiedUI/simplifiedControls/VerticalScrollBar.qml b/interface/resources/qml/hifi/simplifiedUI/simplifiedControls/VerticalScrollBar.qml new file mode 100644 index 0000000000..ab3c0a3f72 --- /dev/null +++ b/interface/resources/qml/hifi/simplifiedUI/simplifiedControls/VerticalScrollBar.qml @@ -0,0 +1,51 @@ +// +// VerticalScrollBar.qml +// +// Created by Zach Fox on 2019-06-17 +// Copyright 2019 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import "../simplifiedConstants" as SimplifiedConstants + +ScrollBar { + SimplifiedConstants.SimplifiedConstants { + id: simplifiedUI + } + + orientation: Qt.Vertical + policy: ScrollBar.AlwaysOn + anchors.top: parent.top + anchors.topMargin: 4 + anchors.right: parent.right + anchors.rightMargin: 4 + anchors.bottom: parent.bottom + anchors.bottomMargin: 4 + width: simplifiedUI.sizes.controls.scrollBar.backgroundWidth + visible: parent.contentHeight > parent.parent.height + position: parent.contentY / parent.contentHeight + size: parent.parent.height / parent.contentHeight + minimumSize: 0.1 + background: Rectangle { + color: simplifiedUI.colors.controls.scrollBar.background + anchors.fill: parent + } + contentItem: Rectangle { + width: simplifiedUI.sizes.controls.scrollBar.contentItemWidth + color: simplifiedUI.colors.controls.scrollBar.contentItem + anchors { + horizontalCenter: parent.horizontalCenter + topMargin: 1 + bottomMargin: 1 + } + } + onPositionChanged: { + if (pressed) { + parent.contentY = position * parent.contentHeight; + } + } +} \ No newline at end of file From e7b852ca3835528b88904580aa441f12bc929029 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 17 Jun 2019 13:18:03 -0700 Subject: [PATCH 10/13] don't try to create collision shape before compound shape resource is finished loading --- libraries/entities-renderer/src/RenderableModelEntityItem.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index 1fc8a2382b..54edd3543c 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -368,6 +368,10 @@ void RenderableModelEntityItem::computeShapeInfo(ShapeInfo& shapeInfo) { } if (type == SHAPE_TYPE_COMPOUND) { + if (!_compoundShapeResource || !_compoundShapeResource->isLoaded()) { + return; + } + updateModelBounds(); // should never fall in here when collision model not fully loaded From cef617af8aeff24229446b876712388a5d3d5461 Mon Sep 17 00:00:00 2001 From: dante ruiz Date: Mon, 17 Jun 2019 14:04:05 -0700 Subject: [PATCH 11/13] be able to rename launcher package --- launchers/darwin/CMakeLists.txt | 3 ++- launchers/darwin/cmake/modules/MacOSXBundleInfo.plist.in | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/launchers/darwin/CMakeLists.txt b/launchers/darwin/CMakeLists.txt index 2de43d93cb..4da675fcc9 100644 --- a/launchers/darwin/CMakeLists.txt +++ b/launchers/darwin/CMakeLists.txt @@ -64,7 +64,8 @@ function(set_from_env _RESULT_NAME _ENV_VAR_NAME _DEFAULT_VALUE) endfunction() add_executable(${PROJECT_NAME} MACOSX_BUNDLE ${src_files}) -set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${APP_NAME}) +set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${APP_NAME} + MACOSX_BUNDLE_BUNDLE_NAME ${APP_NAME}) set_from_env(LAUNCHER_HMAC_SECRET LAUNCHER_HMAC_SECRET "") if (LAUNCHER_HMAC_SECRET STREQUAL "") message(FATAL_ERROR "LAUNCHER_HMAC_SECRET is not set") diff --git a/launchers/darwin/cmake/modules/MacOSXBundleInfo.plist.in b/launchers/darwin/cmake/modules/MacOSXBundleInfo.plist.in index 62d6856ba9..4c87bff3cf 100644 --- a/launchers/darwin/cmake/modules/MacOSXBundleInfo.plist.in +++ b/launchers/darwin/cmake/modules/MacOSXBundleInfo.plist.in @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleExecutable - ${EXECUTABLE_NAME} + ${APP_NAME} CFBundleIconFile ${MACOSX_BUNDLE_ICON_FILE} CFBundleIdentifier @@ -29,7 +29,9 @@ Window NSPrincipalClass NSApplication + CFBundleName + ${MACOSX_BUNDLE_BUNDLE_NAME} CFBundleDisplayName - HQ Launcher + CFBundleName From 9cb4ad61ee401352c89c9b97ffadf16fb4a7a12e Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 17 Jun 2019 15:06:20 -0700 Subject: [PATCH 12/13] BUGZ-699: Make PSFListModel fetch early when making container bigger --- .../qml/hifi/models/PSFListModel.qml | 40 ++++++++++++------- interface/resources/qml/hifi/models/qmldir | 3 ++ 2 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 interface/resources/qml/hifi/models/qmldir diff --git a/interface/resources/qml/hifi/models/PSFListModel.qml b/interface/resources/qml/hifi/models/PSFListModel.qml index b9006bc57c..6dce3f185e 100644 --- a/interface/resources/qml/hifi/models/PSFListModel.qml +++ b/interface/resources/qml/hifi/models/PSFListModel.qml @@ -75,21 +75,31 @@ ListModel { // 1: equivalent to paging when reaching end (and not before). // 0: don't getNextPage on scroll at all here. The application code will do it. property real pageAhead: 2.0; - function needsEarlyYFetch() { - return flickable - && !flickable.atYBeginning - && (flickable.contentY - flickable.originY) >= (flickable.contentHeight - (pageAhead * flickable.height)); + function onContentXChanged() { + if (flickable && + !flickable.atXBeginning && + (flickable.contentX - flickable.originX) >= (flickable.contentWidth - (pageAhead * flickable.width))) { + getNextPage(); + } } - function needsEarlyXFetch() { - return flickable - && !flickable.atXBeginning - && (flickable.contentX - flickable.originX) >= (flickable.contentWidth - (pageAhead * flickable.width)); + function onContentYChanged() { + if (flickable && + !flickable.atYBeginning && + (flickable.contentY - flickable.originY) >= (flickable.contentHeight - (pageAhead * flickable.height))) { + getNextPage(); + } } - function getNextPageIfHorizontalScroll() { - if (needsEarlyXFetch()) { getNextPage(); } + function onWidthChanged() { + if (flickable && + (flickable.contentX - flickable.originX) >= (flickable.contentWidth - (pageAhead * flickable.width))) { + getNextPage(); + } } - function getNextPageIfVerticalScroll() { - if (needsEarlyYFetch()) { getNextPage(); } + function onHeightChanged() { + if (flickable && + (flickable.contentY - flickable.originY) >= (flickable.contentHeight - (pageAhead * flickable.height))) { + getNextPage(); + } } function needsMoreHorizontalResults() { return flickable @@ -118,8 +128,10 @@ ListModel { initialized = true; if (flickable && pageAhead > 0.0) { // Pun: Scrollers are usually one direction or another, such that only one of the following will actually fire. - flickable.contentXChanged.connect(getNextPageIfHorizontalScroll); - flickable.contentYChanged.connect(getNextPageIfVerticalScroll); + flickable.contentXChanged.connect(onContentXChanged); + flickable.contentYChanged.connect(onContentYChanged); + flickable.widthChanged.connect(onWidthChanged); + flickable.heightChanged.connect(onHeightChanged); flickable.contentWidthChanged.connect(getNextPageIfNotEnoughHorizontalResults); flickable.contentHeightChanged.connect(getNextPageIfNotEnoughVerticalResults); } diff --git a/interface/resources/qml/hifi/models/qmldir b/interface/resources/qml/hifi/models/qmldir new file mode 100644 index 0000000000..d4c78941e7 --- /dev/null +++ b/interface/resources/qml/hifi/models/qmldir @@ -0,0 +1,3 @@ +module hifiModels +PSFListModel 1.0 PSFListModel.qml +S3Model 1.0 S3Model.qml From 1801dc9d909293f5c907817f84ae04fb12d88ec6 Mon Sep 17 00:00:00 2001 From: Preston Bezos Date: Mon, 17 Jun 2019 15:18:16 -0700 Subject: [PATCH 13/13] gave previous status a default value --- .../ui/simplifiedStatusIndicator/simplifiedStatusIndicator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/simplifiedUI/ui/simplifiedStatusIndicator/simplifiedStatusIndicator.js b/scripts/simplifiedUI/ui/simplifiedStatusIndicator/simplifiedStatusIndicator.js index 9968260034..789c497104 100644 --- a/scripts/simplifiedUI/ui/simplifiedStatusIndicator/simplifiedStatusIndicator.js +++ b/scripts/simplifiedUI/ui/simplifiedStatusIndicator/simplifiedStatusIndicator.js @@ -152,7 +152,7 @@ function simplifiedStatusIndicator(properties) { // When avatar goes away, set status to busy - var previousStatus; + var previousStatus = "available"; function onWentAway() { previousStatus = currentStatus; if (currentStatus !== "busy") {