added esc key event to fire for the away animation when cycling pause/resume. Reverted change on surface destroy that nullified the surface. Forgot to remove that during testin. Removed comment in away.js with syntax error. Setting cpu/gpu levels back to 1/1 after vr mode is released. Noticed that OS stays in same cpu/gpu level after app closes. Hoping this will help reduce battery drain for user

This commit is contained in:
amer cerkic 2019-02-22 09:11:24 -08:00
parent 9097d9c57c
commit f04fdb2187
3 changed files with 13 additions and 6 deletions

View file

@ -1756,6 +1756,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
#endif
});
// Setup the _keyboardMouseDevice, _touchscreenDevice, _touchscreenVirtualPadDevice and the user input mapper with the default bindings
userInputMapper->registerDevice(_keyboardMouseDevice->getInputDevice());
// if the _touchscreenDevice is not supported it will not be registered
@ -9162,12 +9163,15 @@ void Application::enterForeground() {
auto nodeList = DependencyManager::get<NodeList>();
nodeList->setSendDomainServerCheckInEnabled(true);
}
#endif
void Application::toggleAwayMode(){
auto key = QKeyEvent(QEvent::KeyPress,Qt::Key_Escape,Qt::NoModifier);
_keyboardMouseDevice->keyPressEvent(&key);
qDebug()<<"QQQ_ AWAY MODE ";
QKeyEvent event = QKeyEvent (QEvent::KeyPress, Qt::Key_Escape, Qt::NoModifier);
QCoreApplication::sendEvent (this, &event);
}
#endif
#include "Application.moc"

View file

@ -140,7 +140,11 @@ struct VrSurface : public TaskQueue {
if (vrReady != vrRunning) {
if (vrRunning) {
__android_log_write(ANDROID_LOG_WARN, "QQQ_OVR", "vrapi_LeaveVrMode");
vrapi_SetClockLevels(session, 1, 1);
vrapi_SetExtraLatencyMode(session, VRAPI_EXTRA_LATENCY_MODE_OFF);
vrapi_SetDisplayRefreshRate(session, 60);
vrapi_LeaveVrMode(session);
session = nullptr;
oculusActivity = nullptr;
} else {

View file

@ -154,7 +154,7 @@ function goAway(fromStartup) {
if (!isEnabled || isAway) {
return;
}
console.warn('QQQ_ JS going away);
// If we're entering away mode from some other state than startup, then we create our move timer immediately.
// However if we're just stating up, we need to delay this process so that we don't think the initial teleport
// is actually a move.
@ -176,7 +176,6 @@ function goActive() {
return;
}
console.warn('QQQ_ JS going active);
UserActivityLogger.toggledAway(false);
MyAvatar.isAway = false;