Fix event delivery for apps with native widgets.

Native widgets, which have a NSView but not a
NSWindow, must be created in the hidden state to
prevent Cocoa from selecting them for event delivery.

Change-Id: I741e52729047ad4e03959f2244abe5b14b5df46b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Morten Johan Sørvig 2013-08-30 14:20:21 +02:00 committed by The Qt Project
parent 86f8bee96b
commit a2bdda8e3b

View File

@ -792,6 +792,7 @@ void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow)
QRect rect = window()->geometry();
NSRect frame = NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height());
[m_contentView setFrame:frame];
[m_contentView setHidden: YES];
}
const qreal opacity = qt_window_private(window())->opacity;