summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcocoapanel_mac.mm
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2009-05-20 12:29:10 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-05-20 12:29:10 (GMT)
commit095fe67c4a669f038ea7c14613efe5cb9453fa74 (patch)
treed5bb5d35f59d26b5992c13e36146e805c37eb27e /src/gui/kernel/qcocoapanel_mac.mm
parent675c41f92fa72753fea364b73639fd9e0c7cc0d5 (diff)
parent3f705ded78ed54ec63ca09cc81dfb68bc2235190 (diff)
downloadQt-095fe67c4a669f038ea7c14613efe5cb9453fa74.zip
Qt-095fe67c4a669f038ea7c14613efe5cb9453fa74.tar.gz
Qt-095fe67c4a669f038ea7c14613efe5cb9453fa74.tar.bz2
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
Diffstat (limited to 'src/gui/kernel/qcocoapanel_mac.mm')
-rw-r--r--src/gui/kernel/qcocoapanel_mac.mm11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/kernel/qcocoapanel_mac.mm b/src/gui/kernel/qcocoapanel_mac.mm
index c69826f..b2941fe 100644
--- a/src/gui/kernel/qcocoapanel_mac.mm
+++ b/src/gui/kernel/qcocoapanel_mac.mm
@@ -107,9 +107,16 @@ QT_USE_NAMESPACE
- (void)sendEvent:(NSEvent *)event
{
- [self retain];
-
QWidget *widget = [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] qt_qwidgetForWindow:self];
+
+ // Cocoa can hold onto the window after we've disavowed its knowledge. So,
+ // if we get sent an event afterwards just have it go through the super's
+ // version and don't do any stuff with Qt.
+ if (!widget) {
+ [super sendEvent:event];
+ return;
+ }
+ [self retain];
QT_MANGLE_NAMESPACE(QCocoaView) *view = static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(qt_mac_nativeview_for(widget));
Qt::MouseButton mouseButton = cocoaButton2QtButton([event buttonNumber]);