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());
|
||||
cocoaWindow->setCurrentContext(this);
|
||||
|
||||
[(QNSView *) cocoaWindow->view() setQCocoaGLContext:this];
|
||||
Q_ASSERT(!cocoaWindow->isForeignWindow());
|
||||
[qnsview_cast(cocoaWindow->view()) setQCocoaGLContext:this];
|
||||
}
|
||||
|
||||
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,
|
||||
// so we need to clear any mouse button that triggered the menu popup.
|
||||
if ([view isKindOfClass:[QNSView class]])
|
||||
[(QNSView *)view resetMouseButtons];
|
||||
if (!cocoaWindow->isForeignWindow())
|
||||
[qnsview_cast(view) resetMouseButtons];
|
||||
}
|
||||
|
||||
void QCocoaMenu::dismiss()
|
||||
|
Loading…
Reference in New Issue
Block a user