mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-08-09 00:06:46 +02:00
Crash fix for moving reticle via script.
sendMessage is not thread-safe, use invokeMethod to call into application thread instead.
This commit is contained in:
parent
0d62b10a8f
commit
3d71226f72
3 changed files with 5 additions and 5 deletions
|
@ -2173,9 +2173,9 @@ void Application::maybeToggleMenuVisible(QMouseEvent* event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// called by ApplicationCompositor when in HMD mode and we're faking our mouse movement
|
/// called by ApplicationCompositor when in HMD mode and we're faking our mouse movement
|
||||||
void Application::fakeMouseEvent(QMouseEvent* event) {
|
void Application::fakeMouseEvent(QMouseEvent event) {
|
||||||
_fakedMouseEvent = true;
|
_fakedMouseEvent = true;
|
||||||
sendEvent(_glWidget, event);
|
sendEvent(_glWidget, &event);
|
||||||
_fakedMouseEvent = false;
|
_fakedMouseEvent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -221,8 +221,6 @@ public:
|
||||||
|
|
||||||
float getAverageSimsPerSecond();
|
float getAverageSimsPerSecond();
|
||||||
|
|
||||||
void fakeMouseEvent(QMouseEvent* event);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void svoImportRequested(const QString& url);
|
void svoImportRequested(const QString& url);
|
||||||
|
|
||||||
|
@ -283,6 +281,8 @@ public slots:
|
||||||
|
|
||||||
void runTests();
|
void runTests();
|
||||||
|
|
||||||
|
void fakeMouseEvent(QMouseEvent event);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void showDesktop();
|
void showDesktop();
|
||||||
void clearDomainOctreeDetails();
|
void clearDomainOctreeDetails();
|
||||||
|
|
|
@ -457,7 +457,7 @@ void ApplicationCompositor::setReticlePosition(glm::vec2 position, bool sendFake
|
||||||
auto buttons = QApplication::mouseButtons();
|
auto buttons = QApplication::mouseButtons();
|
||||||
auto modifiers = QApplication::keyboardModifiers();
|
auto modifiers = QApplication::keyboardModifiers();
|
||||||
QMouseEvent event(QEvent::MouseMove, globalPos, button, buttons, modifiers);
|
QMouseEvent event(QEvent::MouseMove, globalPos, button, buttons, modifiers);
|
||||||
qApp->fakeMouseEvent(&event);
|
QMetaObject::invokeMethod(qApp, "fakeMouseEvent", Qt::AutoConnection, Q_ARG(QMouseEvent, event));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// NOTE: This is some debugging code we will leave in while debugging various reticle movement strategies,
|
// NOTE: This is some debugging code we will leave in while debugging various reticle movement strategies,
|
||||||
|
|
Loading…
Reference in a new issue