macOS: Don't try to cast foreign windows to QNSView
Change-Id: I08a4d76310a689c3c855d4c8306f9d7aa5cecadc Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
0b18d51b89
commit
b5068a2831
@ -255,7 +255,8 @@ void QCocoaGLContext::setActiveWindow(QWindow *window)
|
|||||||
QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
|
QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
|
||||||
cocoaWindow->setCurrentContext(this);
|
cocoaWindow->setCurrentContext(this);
|
||||||
|
|
||||||
[(QNSView *) cocoaWindow->view() setQCocoaGLContext:this];
|
Q_ASSERT(!cocoaWindow->isForeignWindow());
|
||||||
|
[qnsview_cast(cocoaWindow->view()) setQCocoaGLContext:this];
|
||||||
}
|
}
|
||||||
|
|
||||||
void QCocoaGLContext::updateSurfaceFormat()
|
void QCocoaGLContext::updateSurfaceFormat()
|
||||||
|
@ -581,8 +581,8 @@ void QCocoaMenu::showPopup(const QWindow *parentWindow, const QRect &targetRect,
|
|||||||
|
|
||||||
// The calls above block, and also swallow any mouse release event,
|
// The calls above block, and also swallow any mouse release event,
|
||||||
// so we need to clear any mouse button that triggered the menu popup.
|
// so we need to clear any mouse button that triggered the menu popup.
|
||||||
if ([view isKindOfClass:[QNSView class]])
|
if (!cocoaWindow->isForeignWindow())
|
||||||
[(QNSView *)view resetMouseButtons];
|
[qnsview_cast(view) resetMouseButtons];
|
||||||
}
|
}
|
||||||
|
|
||||||
void QCocoaMenu::dismiss()
|
void QCocoaMenu::dismiss()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user