mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:57:30 +02:00
Merge pull request #1199 from birarda/master
an actual patch for two finger mouselook fail after dialog
This commit is contained in:
commit
0a2488ad39
1 changed files with 69 additions and 53 deletions
|
@ -22,6 +22,7 @@
|
||||||
#include <QSlider>
|
#include <QSlider>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
|
#include <QWindow>
|
||||||
|
|
||||||
#include <UUID.h>
|
#include <UUID.h>
|
||||||
|
|
||||||
|
@ -718,16 +719,13 @@ void Menu::aboutApp() {
|
||||||
InfoView::forcedShow();
|
InfoView::forcedShow();
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateDSHostname(const QString& domainServerHostname) {
|
void sendFakeEnterEvent() {
|
||||||
QString newHostname(DEFAULT_DOMAIN_HOSTNAME);
|
QPoint lastCursorPosition = QCursor::pos();
|
||||||
|
QGLWidget* glWidget = Application::getInstance()->getGLWidget();
|
||||||
|
|
||||||
if (domainServerHostname.size() > 0) {
|
QPoint windowPosition = glWidget->mapFromGlobal(lastCursorPosition);
|
||||||
// the user input a new hostname, use that
|
QEnterEvent enterEvent = QEnterEvent(windowPosition, windowPosition, lastCursorPosition);
|
||||||
newHostname = domainServerHostname;
|
QCoreApplication::sendEvent(glWidget, &enterEvent);
|
||||||
}
|
|
||||||
|
|
||||||
// give our nodeList the new domain-server hostname
|
|
||||||
NodeList::getInstance()->setDomainHostname(newHostname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const int QLINE_MINIMUM_WIDTH = 400;
|
const int QLINE_MINIMUM_WIDTH = 400;
|
||||||
|
@ -743,11 +741,15 @@ void Menu::login() {
|
||||||
loginDialog.resize(loginDialog.parentWidget()->size().width() * DIALOG_RATIO_OF_WINDOW, loginDialog.size().height());
|
loginDialog.resize(loginDialog.parentWidget()->size().width() * DIALOG_RATIO_OF_WINDOW, loginDialog.size().height());
|
||||||
|
|
||||||
int dialogReturn = loginDialog.exec();
|
int dialogReturn = loginDialog.exec();
|
||||||
|
|
||||||
if (dialogReturn == QDialog::Accepted && !loginDialog.textValue().isEmpty() && loginDialog.textValue() != username) {
|
if (dialogReturn == QDialog::Accepted && !loginDialog.textValue().isEmpty() && loginDialog.textValue() != username) {
|
||||||
// there has been a username change
|
// there has been a username change
|
||||||
// ask for a profile reset with the new username
|
// ask for a profile reset with the new username
|
||||||
Application::getInstance()->resetProfile(loginDialog.textValue());
|
Application::getInstance()->resetProfile(loginDialog.textValue());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendFakeEnterEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::editPreferences() {
|
void Menu::editPreferences() {
|
||||||
|
@ -811,10 +813,7 @@ void Menu::editPreferences() {
|
||||||
layout->addWidget(buttons);
|
layout->addWidget(buttons);
|
||||||
|
|
||||||
int ret = dialog.exec();
|
int ret = dialog.exec();
|
||||||
if (ret != QDialog::Accepted) {
|
if (ret == QDialog::Accepted) {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QUrl faceModelURL(faceURLEdit->text());
|
QUrl faceModelURL(faceURLEdit->text());
|
||||||
|
|
||||||
if (faceModelURL.toString() != faceURLString) {
|
if (faceModelURL.toString() != faceURLString) {
|
||||||
|
@ -857,6 +856,9 @@ void Menu::editPreferences() {
|
||||||
|
|
||||||
_fieldOfView = fieldOfView->value();
|
_fieldOfView = fieldOfView->value();
|
||||||
applicationInstance->resizeGL(applicationInstance->getGLWidget()->width(), applicationInstance->getGLWidget()->height());
|
applicationInstance->resizeGL(applicationInstance->getGLWidget()->width(), applicationInstance->getGLWidget()->height());
|
||||||
|
}
|
||||||
|
|
||||||
|
sendFakeEnterEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::goToDomain() {
|
void Menu::goToDomain() {
|
||||||
|
@ -876,9 +878,19 @@ void Menu::goToDomain() {
|
||||||
domainDialog.resize(domainDialog.parentWidget()->size().width() * DIALOG_RATIO_OF_WINDOW, domainDialog.size().height());
|
domainDialog.resize(domainDialog.parentWidget()->size().width() * DIALOG_RATIO_OF_WINDOW, domainDialog.size().height());
|
||||||
|
|
||||||
int dialogReturn = domainDialog.exec();
|
int dialogReturn = domainDialog.exec();
|
||||||
if (dialogReturn == QDialog::Accepted && !domainDialog.textValue().isEmpty()) {
|
if (dialogReturn == QDialog::Accepted) {
|
||||||
updateDSHostname(domainDialog.textValue());
|
QString newHostname(DEFAULT_DOMAIN_HOSTNAME);
|
||||||
|
|
||||||
|
if (domainDialog.textValue().size() > 0) {
|
||||||
|
// the user input a new hostname, use that
|
||||||
|
newHostname = domainDialog.textValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// give our nodeList the new domain-server hostname
|
||||||
|
NodeList::getInstance()->setDomainHostname(domainDialog.textValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
sendFakeEnterEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::goToLocation() {
|
void Menu::goToLocation() {
|
||||||
|
@ -918,6 +930,8 @@ void Menu::goToLocation() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendFakeEnterEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::goToUser() {
|
void Menu::goToUser() {
|
||||||
|
@ -935,6 +949,8 @@ void Menu::goToUser() {
|
||||||
DataServerClient::getValuesForKeysAndUserString((QStringList() << DataServerKey::Domain << DataServerKey::Position),
|
DataServerClient::getValuesForKeysAndUserString((QStringList() << DataServerKey::Domain << DataServerKey::Position),
|
||||||
userDialog.textValue());
|
userDialog.textValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendFakeEnterEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::bandwidthDetails() {
|
void Menu::bandwidthDetails() {
|
||||||
|
|
Loading…
Reference in a new issue