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>
Cocoa: Unregister view from window's notifications only

Otherwise the view will miss its own frame change notifications.
And we must unregister from all the notifications during dealloc.

This would also reveal a bug where we would expose an NSView before
its super view is visible, leading to those "invalid drawable" warnings
when using QQuickViews. Therefore, we add this extra check in
QCocoaWindow::exposeWindow().

Task-number: QTBUG-32826
Change-Id: I69018cb6f199b242768d114b2aa34c7f2d243196
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Cocoa: Fix NSMenu popup coordinates

Those should be in window coordinates (or rather, its content view)
not view coordinates.

Task-number: QTBUG-32826
Change-Id: I52dddeccf17b359163ad477ce4299b934633b4fa
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>