mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 13:49:23 +02:00
Merge pull request #7956 from jherico/web_entity_crash
fix crash on click on non-visible web-entity
This commit is contained in:
commit
c85923c69b
2 changed files with 14 additions and 2 deletions
|
@ -994,7 +994,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
|
||||||
if (_keyboardFocusedItem != entityItemID) {
|
if (_keyboardFocusedItem != entityItemID) {
|
||||||
_keyboardFocusedItem = UNKNOWN_ENTITY_ID;
|
_keyboardFocusedItem = UNKNOWN_ENTITY_ID;
|
||||||
auto properties = entityScriptingInterface->getEntityProperties(entityItemID);
|
auto properties = entityScriptingInterface->getEntityProperties(entityItemID);
|
||||||
if (EntityTypes::Web == properties.getType() && !properties.getLocked()) {
|
if (EntityTypes::Web == properties.getType() && !properties.getLocked() && properties.getVisible()) {
|
||||||
auto entity = entityScriptingInterface->getEntityTree()->findEntityByID(entityItemID);
|
auto entity = entityScriptingInterface->getEntityTree()->findEntityByID(entityItemID);
|
||||||
RenderableWebEntityItem* webEntity = dynamic_cast<RenderableWebEntityItem*>(entity.get());
|
RenderableWebEntityItem* webEntity = dynamic_cast<RenderableWebEntityItem*>(entity.get());
|
||||||
if (webEntity) {
|
if (webEntity) {
|
||||||
|
@ -1049,6 +1049,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) :
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connect(this, &Application::aboutToQuit, [=]() {
|
||||||
|
_keyboardFocusedItem = UNKNOWN_ENTITY_ID;
|
||||||
|
if (_keyboardFocusHighlight) {
|
||||||
|
_keyboardFocusHighlight->setVisible(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Make sure we don't time out during slow operations at startup
|
// Make sure we don't time out during slow operations at startup
|
||||||
updateHeartbeat();
|
updateHeartbeat();
|
||||||
|
|
||||||
|
|
|
@ -226,10 +226,15 @@ void RenderableWebEntityItem::setSourceUrl(const QString& value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderableWebEntityItem::setProxyWindow(QWindow* proxyWindow) {
|
void RenderableWebEntityItem::setProxyWindow(QWindow* proxyWindow) {
|
||||||
_webSurface->setProxyWindow(proxyWindow);
|
if (_webSurface) {
|
||||||
|
_webSurface->setProxyWindow(proxyWindow);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QObject* RenderableWebEntityItem::getEventHandler() {
|
QObject* RenderableWebEntityItem::getEventHandler() {
|
||||||
|
if (!_webSurface) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
return _webSurface->getEventHandler();
|
return _webSurface->getEventHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue