mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:37:58 +02:00
fix crash in activateWindowAfterEnterMode in no oculus case
This commit is contained in:
parent
ad6680553c
commit
0c5a978411
1 changed files with 5 additions and 3 deletions
|
@ -126,9 +126,9 @@ void HMDToolsDialog::enterModeClicked(bool checked) {
|
||||||
|
|
||||||
void HMDToolsDialog::activateWindowAfterEnterMode() {
|
void HMDToolsDialog::activateWindowAfterEnterMode() {
|
||||||
Application::getInstance()->getWindow()->activateWindow();
|
Application::getInstance()->getWindow()->activateWindow();
|
||||||
QWindow* mainWindow = Application::getInstance()->getWindow()->windowHandle();
|
|
||||||
QPoint windowCenter = mainWindow->geometry().center();
|
// center the cursor on the main application window
|
||||||
QCursor::setPos(_hmdScreen, windowCenter);
|
centerCursorOnWidget(Application::getInstance()->getWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -178,10 +178,12 @@ void HMDToolsDialog::centerCursorOnWidget(QWidget* widget) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HMDToolsDialog::showEvent(QShowEvent* event) {
|
void HMDToolsDialog::showEvent(QShowEvent* event) {
|
||||||
|
// center the cursor on the hmd tools dialog
|
||||||
centerCursorOnWidget(this);
|
centerCursorOnWidget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HMDToolsDialog::hideEvent(QHideEvent* event) {
|
void HMDToolsDialog::hideEvent(QHideEvent* event) {
|
||||||
|
// center the cursor on the main application window
|
||||||
centerCursorOnWidget(Application::getInstance()->getWindow());
|
centerCursorOnWidget(Application::getInstance()->getWindow());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue