mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 07:12:40 +02:00
- OSX fixes (right camera after coming from native window, disappearing content)
- Fix show() to show the window after it was minimized
This commit is contained in:
parent
3a32472b0b
commit
1b63dfa20a
2 changed files with 34 additions and 3 deletions
|
@ -90,18 +90,26 @@ Windows.Window {
|
|||
}
|
||||
}
|
||||
|
||||
function updateContentParent() {
|
||||
if (presentationMode === Desktop.PresentationMode.VIRTUAL) {
|
||||
contentHolder.parent = root;
|
||||
} else if (presentationMode === Desktop.PresentationMode.NATIVE && nativeWindow) {
|
||||
contentHolder.parent = nativeWindow.contentItem;
|
||||
}
|
||||
}
|
||||
|
||||
function setupPresentationMode() {
|
||||
if (presentationMode === Desktop.PresentationMode.VIRTUAL) {
|
||||
if (nativeWindow) {
|
||||
nativeWindow.setVisible(false);
|
||||
}
|
||||
contentHolder.parent = root;
|
||||
updateContentParent();
|
||||
updateInteractiveWindowPositionForMode();
|
||||
shown = interactiveWindowVisible;
|
||||
} else if (presentationMode === Desktop.PresentationMode.NATIVE) {
|
||||
shown = false;
|
||||
if (nativeWindow) {
|
||||
contentHolder.parent = nativeWindow.contentItem;
|
||||
updateContentParent();
|
||||
updateInteractiveWindowPositionForMode();
|
||||
nativeWindow.setVisible(interactiveWindowVisible);
|
||||
}
|
||||
|
@ -111,6 +119,14 @@ Windows.Window {
|
|||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
// Fix for parent loss on OSX:
|
||||
parent.heightChanged.connect(function() {
|
||||
updateContentParent();
|
||||
});
|
||||
parent.widthChanged.connect(function() {
|
||||
updateContentParent();
|
||||
});
|
||||
|
||||
x = interactiveWindowPosition.x;
|
||||
y = interactiveWindowPosition.y;
|
||||
width = interactiveWindowSize.width;
|
||||
|
@ -211,7 +227,11 @@ Windows.Window {
|
|||
if (presentationMode === Desktop.PresentationMode.VIRTUAL) {
|
||||
shown = interactiveWindowVisible;
|
||||
} else if (presentationMode === Desktop.PresentationMode.NATIVE && nativeWindow) {
|
||||
nativeWindow.setVisible(interactiveWindowVisible);
|
||||
if (!nativeWindow.visible && interactiveWindowVisible) {
|
||||
nativeWindow.showNormal();
|
||||
} else {
|
||||
nativeWindow.setVisible(interactiveWindowVisible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4021,7 +4021,18 @@ void Application::mousePressEvent(QMouseEvent* event) {
|
|||
return;
|
||||
}
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
// Fix for OSX right click dragging on window when coming from a native window
|
||||
bool isFocussed = hasFocus();
|
||||
if (!isFocussed && event->button() == Qt::MouseButton::RightButton) {
|
||||
setFocus();
|
||||
isFocussed = true;
|
||||
}
|
||||
|
||||
if (isFocussed) {
|
||||
#else
|
||||
if (hasFocus()) {
|
||||
#endif
|
||||
if (_keyboardMouseDevice->isActive()) {
|
||||
_keyboardMouseDevice->mousePressEvent(event);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue