summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2014-09-18 17:37:23 +0200
committerGabriel de Dietrich <gabriel.dedietrich@digia.com>2014-09-22 14:11:08 +0200
commit65a991e57e862e498fcae741f03ba1727a76fc80 (patch)
treee769cfd7c5f77e9c4702c1ba96f6416b47a02f00 /src/plugins/platforms/cocoa
parent87fbfe074bf78506b3994ccd5c1c4b82ce2b6a71 (diff)
Make sure we don't delete child QWindows if they have WA_NativeWindow set
Deleting a QWindow automatically deletes its child windows because they are in the QObject hierarchy. However, if the user sets both WA_NativeWindow and WA_DontCreateNativeAncestors, we can't just delete that widget's QWindow. First because the widget doesn't get notified (and maybe it should be), and then because we may invalidate any reference to the QWindow the user may have kept. Our solution is to reparent the child QWindows into the new parent's closest QWindow. We must, however, take the precaution of not keeping any reference to the backing store in the platform window. Reparenting operations can trigger repaints on the platform window, but the backing store is not set and flushed until later. Task-number: QTBUG-38377 Change-Id: I353f5528f227a227b6d10419367cbe1d5d07a94e Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 86691456b8..a4671845b7 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -580,6 +580,8 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
CGImageRelease(subMask);
[self invalidateWindowShadowIfNeeded];
+
+ m_backingStore = 0;
}
- (BOOL) isFlipped