Cocoa plugin - fix obscured/mapped/unmapped logic
NSWindow setStyleMask can call viewDidMoveToWindow,
while setting the mask, view can have window == nil and we call 'obscure'
on this view's platform window/QWindow == 'unmapping' it.
As a result, it can happen that a child view (for example, QGLWidget's view)
never gets mapped back. This patch tries to limit this special
obscure/expose logic by the exact views it was introduced for
(c7bd85e97d
, QTBUG-19840).
Change-Id: I4cc7a6b1bd3e34741ad50c2e0d2a2add242b28e4
Task-number: QTBUG-41701
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
This commit is contained in:
parent
a40d390a3b
commit
d50eb5e8ac
@ -75,6 +75,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
|
||||
QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) *m_mouseMoveHelper;
|
||||
bool m_resendKeyEvent;
|
||||
bool m_scrolling;
|
||||
bool m_exposedOnMoveToWindow;
|
||||
}
|
||||
|
||||
- (id)init;
|
||||
|
@ -272,10 +272,13 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
|
||||
if (self.window) {
|
||||
// This is the case of QWidgetAction's generated QWidget inserted in an NSMenu.
|
||||
// 10.9 and newer get the NSWindowDidChangeOcclusionStateNotification
|
||||
if (!_q_NSWindowDidChangeOcclusionStateNotification
|
||||
&& [self.window.className isEqualToString:@"NSCarbonMenuWindow"])
|
||||
if ((!_q_NSWindowDidChangeOcclusionStateNotification
|
||||
&& [self.window.className isEqualToString:@"NSCarbonMenuWindow"])) {
|
||||
m_exposedOnMoveToWindow = true;
|
||||
m_platformWindow->exposeWindow();
|
||||
} else {
|
||||
}
|
||||
} else if (m_exposedOnMoveToWindow) {
|
||||
m_exposedOnMoveToWindow = false;
|
||||
m_platformWindow->obscureWindow();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user