Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -679,7 +679,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 678 unmodified lines | |||
| 679 | [this, entityScriptingInterface](const EntityItemID& entityItemID, const MouseEvent& event) { | 679 | [this, entityScriptingInterface](const EntityItemID& entityItemID, const MouseEvent& event) { |
| 680 | if (_keyboardFocusedItem != entityItemID) { | 680 | if (_keyboardFocusedItem != entityItemID) { |
| 681 | _keyboardFocusedItem = UNKNOWN_ENTITY_ID; | 681 | _keyboardFocusedItem = UNKNOWN_ENTITY_ID; |
| 682 | qDebug() << "clickDownOnEntity.... _keyboardFocusedItem:" << UNKNOWN_ENTITY_ID; | ||
| 683 | auto properties = entityScriptingInterface->getEntityProperties(entityItemID); | 682 | auto properties = entityScriptingInterface->getEntityProperties(entityItemID); |
| 684 | if (EntityTypes::Web == properties.getType() && !properties.getLocked()) { | 683 | if (EntityTypes::Web == properties.getType() && !properties.getLocked()) { |
| 685 | auto entity = entityScriptingInterface->getEntityTree()->findEntityByID(entityItemID); | 684 | auto entity = entityScriptingInterface->getEntityTree()->findEntityByID(entityItemID); |
| @@ -688,7 +687,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 2 unmodified lines | |||
| 688 | webEntity->setProxyWindow(_window->windowHandle()); | 687 | webEntity->setProxyWindow(_window->windowHandle()); |
| 689 | _keyboardFocusedItem = entityItemID; | 688 | _keyboardFocusedItem = entityItemID; |
| 690 | _lastAcceptedKeyPress = usecTimestampNow(); | 689 | _lastAcceptedKeyPress = usecTimestampNow(); |
| 691 | qDebug() << "clickDownOnEntity.... _keyboardFocusedItem:" << entityItemID; | ||
| 692 | } | 690 | } |
| 693 | } | 691 | } |
| 694 | } | 692 | } |
| @@ -698,7 +696,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 3 unmodified lines | |||
| 698 | connect(getEntities(), &EntityTreeRenderer::mousePressOffEntity, | 696 | connect(getEntities(), &EntityTreeRenderer::mousePressOffEntity, |
| 699 | [=](const RayToEntityIntersectionResult& entityItemID, const QMouseEvent* event, unsigned int deviceId) { | 697 | [=](const RayToEntityIntersectionResult& entityItemID, const QMouseEvent* event, unsigned int deviceId) { |
| 700 | _keyboardFocusedItem = UNKNOWN_ENTITY_ID; | 698 | _keyboardFocusedItem = UNKNOWN_ENTITY_ID; |
| 701 | qDebug() << "mousePressOffEntity... _keyboardFocusedItem:" << UNKNOWN_ENTITY_ID; | ||
| 702 | }); | 699 | }); |
| 703 | } | 700 | } |
| 704 | 701 | ||
| @@ -1277,7 +1274,6 @@ bool Application::event(QEvent* event) { · 572 unmodified lines | |||
| 1277 | QCoreApplication::sendEvent(webEntity->getEventHandler(), event); | 1274 | QCoreApplication::sendEvent(webEntity->getEventHandler(), event); |
| 1278 | if (event->isAccepted()) { | 1275 | if (event->isAccepted()) { |
| 1279 | _lastAcceptedKeyPress = usecTimestampNow(); | 1276 | _lastAcceptedKeyPress = usecTimestampNow(); |
| 1280 | qDebug() << "Application::event() key event... _lastAcceptedKeyPress:" << _lastAcceptedKeyPress; | ||
| 1281 | return true; | 1277 | return true; |
| 1282 | } | 1278 | } |
| 1283 | } | 1279 | } |
| @@ -1287,18 +1283,6 @@ bool Application::event(QEvent* event) { · 3 unmodified lines | |||
| 1287 | default: | 1283 | default: |
| 1288 | break; | 1284 | break; |
| 1289 | } | 1285 | } |
| 1290 | |||
| 1291 | /* | ||
| 1292 | const quint64 LOSE_FOCUS_AFTER_ELAPSED_TIME = 30 * USECS_PER_SECOND; // if idle for 30 seconds, drop focus | ||
| 1293 | quint64 elapsedSinceAcceptedKeyPress = usecTimestampNow() - _lastAcceptedKeyPress; | ||
| 1294 | if (elapsedSinceAcceptedKeyPress > LOSE_FOCUS_AFTER_ELAPSED_TIME) { | ||
| 1295 | _keyboardFocusedItem = UNKNOWN_ENTITY_ID; | ||
| 1296 | qDebug() << "idle for 30 seconds.... _keyboardFocusedItem:" << UNKNOWN_ENTITY_ID; | ||
| 1297 | } else { | ||
| 1298 | qDebug() << "elapsedSinceAcceptedKeyPress:" << elapsedSinceAcceptedKeyPress; | ||
| 1299 | } | ||
| 1300 | */ | ||
| 1301 | |||
| 1302 | } | 1286 | } |
| 1303 | 1287 | ||
| 1304 | switch (event->type()) { | 1288 | switch (event->type()) { |
| @@ -2006,17 +1990,13 @@ void Application::idle() { · 701 unmodified lines | |||
| 2006 | return; // bail early, nothing to do here. | 1990 | return; // bail early, nothing to do here. |
| 2007 | } | 1991 | } |
| 2008 | 1992 | ||
| 1993 | // Drop focus from _keyboardFocusedItem if no keyboard messages for 30 seconds | ||
| 2009 | if (!_keyboardFocusedItem.isInvalidID()) { | 1994 | if (!_keyboardFocusedItem.isInvalidID()) { |
| 2010 | const quint64 LOSE_FOCUS_AFTER_ELAPSED_TIME = 30 * USECS_PER_SECOND; // if idle for 30 seconds, drop focus | 1995 | const quint64 LOSE_FOCUS_AFTER_ELAPSED_TIME = 30 * USECS_PER_SECOND; // if idle for 30 seconds, drop focus |
| 2011 | quint64 elapsedSinceAcceptedKeyPress = usecTimestampNow() - _lastAcceptedKeyPress; | 1996 | quint64 elapsedSinceAcceptedKeyPress = usecTimestampNow() - _lastAcceptedKeyPress; |
| 2012 | if (elapsedSinceAcceptedKeyPress > LOSE_FOCUS_AFTER_ELAPSED_TIME) { | 1997 | if (elapsedSinceAcceptedKeyPress > LOSE_FOCUS_AFTER_ELAPSED_TIME) { |
| 2013 | _keyboardFocusedItem = UNKNOWN_ENTITY_ID; | 1998 | _keyboardFocusedItem = UNKNOWN_ENTITY_ID; |
| 2014 | qDebug() << "Application::idle() no key messages for 30 seconds.... _keyboardFocusedItem: UNKNOWN_ENTITY_ID:" << UNKNOWN_ENTITY_ID; | ||
| 2015 | } else { | ||
| 2016 | qDebug() << "Application::idle() _keyboardFocusedItem:" << _keyboardFocusedItem << "elapsedSinceAcceptedKeyPress:" << elapsedSinceAcceptedKeyPress; | ||
| 2017 | } | 1999 | } |
| 2018 | } else { | ||
| 2019 | qDebug() << "Application::idle() no focused item, who cares..."; | ||
| 2020 | } | 2000 | } |
| 2021 | 2001 | ||
| 2022 | // Normally we check PipelineWarnings, but since idle will often take more than 10ms we only show these idle timing | 2002 | // Normally we check PipelineWarnings, but since idle will often take more than 10ms we only show these idle timing |