mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 18:30:42 +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 <QStandardPaths>
|
||||
#include <QUuid>
|
||||
#include <QWindow>
|
||||
|
||||
#include <UUID.h>
|
||||
|
||||
|
@ -718,16 +719,13 @@ void Menu::aboutApp() {
|
|||
InfoView::forcedShow();
|
||||
}
|
||||
|
||||
void updateDSHostname(const QString& domainServerHostname) {
|
||||
QString newHostname(DEFAULT_DOMAIN_HOSTNAME);
|
||||
void sendFakeEnterEvent() {
|
||||
QPoint lastCursorPosition = QCursor::pos();
|
||||
QGLWidget* glWidget = Application::getInstance()->getGLWidget();
|
||||
|
||||
if (domainServerHostname.size() > 0) {
|
||||
// the user input a new hostname, use that
|
||||
newHostname = domainServerHostname;
|
||||
}
|
||||
|
||||
// give our nodeList the new domain-server hostname
|
||||
NodeList::getInstance()->setDomainHostname(newHostname);
|
||||
QPoint windowPosition = glWidget->mapFromGlobal(lastCursorPosition);
|
||||
QEnterEvent enterEvent = QEnterEvent(windowPosition, windowPosition, lastCursorPosition);
|
||||
QCoreApplication::sendEvent(glWidget, &enterEvent);
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
int dialogReturn = loginDialog.exec();
|
||||
|
||||
if (dialogReturn == QDialog::Accepted && !loginDialog.textValue().isEmpty() && loginDialog.textValue() != username) {
|
||||
// there has been a username change
|
||||
// ask for a profile reset with the new username
|
||||
Application::getInstance()->resetProfile(loginDialog.textValue());
|
||||
|
||||
}
|
||||
|
||||
sendFakeEnterEvent();
|
||||
}
|
||||
|
||||
void Menu::editPreferences() {
|
||||
|
@ -811,10 +813,7 @@ void Menu::editPreferences() {
|
|||
layout->addWidget(buttons);
|
||||
|
||||
int ret = dialog.exec();
|
||||
if (ret != QDialog::Accepted) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ret == QDialog::Accepted) {
|
||||
QUrl faceModelURL(faceURLEdit->text());
|
||||
|
||||
if (faceModelURL.toString() != faceURLString) {
|
||||
|
@ -857,6 +856,9 @@ void Menu::editPreferences() {
|
|||
|
||||
_fieldOfView = fieldOfView->value();
|
||||
applicationInstance->resizeGL(applicationInstance->getGLWidget()->width(), applicationInstance->getGLWidget()->height());
|
||||
}
|
||||
|
||||
sendFakeEnterEvent();
|
||||
}
|
||||
|
||||
void Menu::goToDomain() {
|
||||
|
@ -876,9 +878,19 @@ void Menu::goToDomain() {
|
|||
domainDialog.resize(domainDialog.parentWidget()->size().width() * DIALOG_RATIO_OF_WINDOW, domainDialog.size().height());
|
||||
|
||||
int dialogReturn = domainDialog.exec();
|
||||
if (dialogReturn == QDialog::Accepted && !domainDialog.textValue().isEmpty()) {
|
||||
updateDSHostname(domainDialog.textValue());
|
||||
if (dialogReturn == QDialog::Accepted) {
|
||||
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() {
|
||||
|
@ -918,6 +930,8 @@ void Menu::goToLocation() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
sendFakeEnterEvent();
|
||||
}
|
||||
|
||||
void Menu::goToUser() {
|
||||
|
@ -935,6 +949,8 @@ void Menu::goToUser() {
|
|||
DataServerClient::getValuesForKeysAndUserString((QStringList() << DataServerKey::Domain << DataServerKey::Position),
|
||||
userDialog.textValue());
|
||||
}
|
||||
|
||||
sendFakeEnterEvent();
|
||||
}
|
||||
|
||||
void Menu::bandwidthDetails() {
|
||||
|
|
Loading…
Reference in a new issue