mirror of
https://github.com/overte-org/overte.git
synced 2025-08-13 19:19:42 +02:00
fewer undesirable couplings
This commit is contained in:
parent
d274d99411
commit
c6b636901a
3 changed files with 6 additions and 3 deletions
|
@ -894,7 +894,7 @@ void Overlays::mousePressEvent(const OverlayID& overlayID, const PointerEvent& e
|
|||
auto thisOverlay = std::dynamic_pointer_cast<Web3DOverlay>(getOverlay(overlayID));
|
||||
if (thisOverlay) {
|
||||
// Focus keyboard on web overlays
|
||||
qApp->setKeyboardFocusEntity(UNKNOWN_ENTITY_ID);
|
||||
DependencyManager::get<EntityScriptingInterface>()->setKeyboardFocusEntity(UNKNOWN_ENTITY_ID);
|
||||
setKeyboardFocusOverlay(overlayID);
|
||||
|
||||
// Send to web overlay
|
||||
|
|
|
@ -567,8 +567,6 @@ void EntityTreeRenderer::mousePressEvent(QMouseEvent* event) {
|
|||
_lastPointerEventValid = true;
|
||||
|
||||
} else {
|
||||
// If the user clicks somewhere where there is NO entity at all, we will release focus
|
||||
QMetaObject::invokeMethod(qApp, "setKeyboardFocusEntity", Qt::DirectConnection, Q_ARG(EntityItemID, UNKNOWN_ENTITY_ID));
|
||||
emit entityScriptingInterface->mousePressOffEntity();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,6 +50,11 @@ EntityScriptingInterface::EntityScriptingInterface(bool bidOnSimulationOwnership
|
|||
connect(nodeList.data(), &NodeList::canRezCertifiedChanged, this, &EntityScriptingInterface::canRezCertifiedChanged);
|
||||
connect(nodeList.data(), &NodeList::canRezTmpCertifiedChanged, this, &EntityScriptingInterface::canRezTmpCertifiedChanged);
|
||||
connect(nodeList.data(), &NodeList::canWriteAssetsChanged, this, &EntityScriptingInterface::canWriteAssetsChanged);
|
||||
|
||||
// If the user clicks somewhere where there is no entity at all, we will release focus
|
||||
connect(this, &EntityScriptingInterface::mousePressOffEntity, [=]() {
|
||||
setKeyboardFocusEntity(UNKNOWN_ENTITY_ID);
|
||||
});
|
||||
}
|
||||
|
||||
void EntityScriptingInterface::queueEntityMessage(PacketType packetType,
|
||||
|
|
Loading…
Reference in a new issue