macOS: Don't keep window flags around, we can get them from the QWindow
Change-Id: I629a58e699ad39ec429e1e275152434db4abc572 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
56149c0fbb
commit
d2ee858194
@ -241,7 +241,6 @@ public: // for QNSView
|
||||
bool m_viewIsEmbedded; // true if the m_view is actually embedded in a "foreign" NSView hiearchy
|
||||
bool m_viewIsToBeEmbedded; // true if the m_view is intended to be embedded in a "foreign" NSView hiearchy
|
||||
|
||||
Qt::WindowFlags m_windowFlags;
|
||||
Qt::WindowStates m_lastReportedWindowState;
|
||||
Qt::WindowModality m_windowModality;
|
||||
QPointer<QWindow> m_enterLeaveTargetWindow;
|
||||
|
@ -550,7 +550,9 @@ void QCocoaWindow::setWindowZoomButton(Qt::WindowFlags flags)
|
||||
|
||||
void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
|
||||
{
|
||||
if (isContentView()) {
|
||||
if (!isContentView())
|
||||
return;
|
||||
|
||||
// While setting style mask we can have handleGeometryChange calls on a content
|
||||
// view with null geometry, reporting an invalid coordinates as a result.
|
||||
m_inSetStyleMask = true;
|
||||
@ -587,9 +589,6 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
|
||||
bool ignoreMouse = flags & Qt::WindowTransparentForInput;
|
||||
if (m_view.window.ignoresMouseEvents != ignoreMouse)
|
||||
m_view.window.ignoresMouseEvents = ignoreMouse;
|
||||
}
|
||||
|
||||
m_windowFlags = flags;
|
||||
}
|
||||
|
||||
void QCocoaWindow::setWindowState(Qt::WindowStates state)
|
||||
@ -742,7 +741,7 @@ void QCocoaWindow::propagateSizeHints()
|
||||
window.contentMaxSize = NSSizeFromCGSize(windowMaximumSize().toCGSize());
|
||||
|
||||
// The window may end up with a fixed size; in this case the zoom button should be disabled.
|
||||
setWindowZoomButton(m_windowFlags);
|
||||
setWindowZoomButton(this->window()->flags());
|
||||
|
||||
// sizeIncrement is observed to take values of (-1, -1) and (0, 0) for windows that should be
|
||||
// resizable and that have no specific size increment set. Cocoa expects (1.0, 1.0) in this case.
|
||||
@ -995,7 +994,7 @@ void QCocoaWindow::windowDidEnterFullScreen()
|
||||
"FullScreen category processes window notifications first");
|
||||
|
||||
// Reset to original styleMask
|
||||
setWindowFlags(m_windowFlags);
|
||||
setWindowFlags(window()->flags());
|
||||
|
||||
handleWindowStateChanged();
|
||||
}
|
||||
@ -1019,7 +1018,7 @@ void QCocoaWindow::windowDidExitFullScreen()
|
||||
"FullScreen category processes window notifications first");
|
||||
|
||||
// Reset to original styleMask
|
||||
setWindowFlags(m_windowFlags);
|
||||
setWindowFlags(window()->flags());
|
||||
|
||||
Qt::WindowState requestedState = window()->windowState();
|
||||
|
||||
|
@ -546,7 +546,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
|
||||
if (QCocoaWindow *popup = QCocoaIntegration::instance()->activePopupWindow()) {
|
||||
// Tooltips must be transparent for mouse events
|
||||
// The bug reference is QTBUG-46379
|
||||
if (!popup->m_windowFlags.testFlag(Qt::ToolTip)) {
|
||||
if (!popup->window()->flags().testFlag(Qt::ToolTip)) {
|
||||
if (QNSView *popupView = qnsview_cast(popup->view()))
|
||||
targetView = popupView;
|
||||
}
|
||||
@ -1437,7 +1437,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
|
||||
// Popups implicitly grab key events; forward to the active popup if there is one.
|
||||
// This allows popups to e.g. intercept shortcuts and close the popup in response.
|
||||
if (QCocoaWindow *popup = QCocoaIntegration::instance()->activePopupWindow()) {
|
||||
if (!popup->m_windowFlags.testFlag(Qt::ToolTip))
|
||||
if (!popup->window()->flags().testFlag(Qt::ToolTip))
|
||||
window = popup->window();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user