mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +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() {
|
||||
Application::getInstance()->getWindow()->activateWindow();
|
||||
QWindow* mainWindow = Application::getInstance()->getWindow()->windowHandle();
|
||||
QPoint windowCenter = mainWindow->geometry().center();
|
||||
QCursor::setPos(_hmdScreen, windowCenter);
|
||||
|
||||
// center the cursor on the main application window
|
||||
centerCursorOnWidget(Application::getInstance()->getWindow());
|
||||
}
|
||||
|
||||
|
||||
|
@ -178,10 +178,12 @@ void HMDToolsDialog::centerCursorOnWidget(QWidget* widget) {
|
|||
}
|
||||
|
||||
void HMDToolsDialog::showEvent(QShowEvent* event) {
|
||||
// center the cursor on the hmd tools dialog
|
||||
centerCursorOnWidget(this);
|
||||
}
|
||||
|
||||
void HMDToolsDialog::hideEvent(QHideEvent* event) {
|
||||
// center the cursor on the main application window
|
||||
centerCursorOnWidget(Application::getInstance()->getWindow());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue