From 6108f7d9cd1e60c2bfdc465c09e50b030c8808be Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Tue, 25 Nov 2014 12:45:20 -0800 Subject: [PATCH] fix bug in resetSensors moving cursor to center of window on multiple screen systems --- interface/src/Application.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index cd7dc813a6..90b4501662 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3502,7 +3502,6 @@ void Application::deleteVoxelAt(const VoxelDetail& voxel) { } } - void Application::resetSensors() { _mouseX = _glWidget->width() / 2; _mouseY = _glWidget->height() / 2; @@ -3516,7 +3515,11 @@ void Application::resetSensors() { _prioVR.reset(); //_leapmotion.reset(); - QCursor::setPos(_mouseX, _mouseY); + QScreen* currentScreen = _window->windowHandle()->screen(); + QWindow* mainWindow = _window->windowHandle(); + QPoint windowCenter = mainWindow->geometry().center(); + QCursor::setPos(currentScreen, windowCenter); + _myAvatar->reset(); QMetaObject::invokeMethod(&_audio, "reset", Qt::QueuedConnection);