mirror of
https://github.com/lubosz/overte.git
synced 2025-06-04 05:10:27 +02:00
Merge pull request #11671 from ElderOrb/case8553
8380 Mouse Disappears when switching between HMD and Desktop Mode while in Create
This commit is contained in:
commit
66e38af1b3
1 changed files with 8 additions and 2 deletions
|
@ -234,7 +234,8 @@ void CompositorHelper::handleLeaveEvent() {
|
||||||
|
|
||||||
bool CompositorHelper::handleRealMouseMoveEvent(bool sendFakeEvent) {
|
bool CompositorHelper::handleRealMouseMoveEvent(bool sendFakeEvent) {
|
||||||
// If the mouse move came from a capture mouse related move, we completely ignore it.
|
// If the mouse move came from a capture mouse related move, we completely ignore it.
|
||||||
if (_ignoreMouseMove) {
|
// Note: if not going to synthesize event - do not touch _ignoreMouseMove flag
|
||||||
|
if (_ignoreMouseMove && sendFakeEvent) {
|
||||||
_ignoreMouseMove = false;
|
_ignoreMouseMove = false;
|
||||||
return true; // swallow the event
|
return true; // swallow the event
|
||||||
}
|
}
|
||||||
|
@ -246,7 +247,12 @@ bool CompositorHelper::handleRealMouseMoveEvent(bool sendFakeEvent) {
|
||||||
auto changeInRealMouse = newPosition - _lastKnownRealMouse;
|
auto changeInRealMouse = newPosition - _lastKnownRealMouse;
|
||||||
auto newReticlePosition = _reticlePositionInHMD + toGlm(changeInRealMouse);
|
auto newReticlePosition = _reticlePositionInHMD + toGlm(changeInRealMouse);
|
||||||
setReticlePosition(newReticlePosition, sendFakeEvent);
|
setReticlePosition(newReticlePosition, sendFakeEvent);
|
||||||
|
|
||||||
|
// Note: if not going to synthesize event - do not touch _ignoreMouseMove flag
|
||||||
|
if (sendFakeEvent) {
|
||||||
_ignoreMouseMove = true;
|
_ignoreMouseMove = true;
|
||||||
|
}
|
||||||
|
|
||||||
QCursor::setPos(QPoint(_lastKnownRealMouse.x(), _lastKnownRealMouse.y())); // move cursor back to where it was
|
QCursor::setPos(QPoint(_lastKnownRealMouse.x(), _lastKnownRealMouse.y())); // move cursor back to where it was
|
||||||
return true; // swallow the event
|
return true; // swallow the event
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue