Cocoa: do not send multiple window activation events
authorBradley T. Hughes <bradley.hughes@nokia.com>
Wed, 6 Jun 2012 07:25:01 +0000 (09:25 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 6 Jun 2012 10:07:48 +0000 (12:07 +0200)
commite8cd9a617d85deebb6407973fd1fb11a6486ee99
treeddbeae1e1087c43f008f3c5f78b6d2380dde3b22
parent80653bf4ce8d03f4af2fe8cc2f3751d32bd31d75
Cocoa: do not send multiple window activation events

When switching the active window within the same application, Cocoa
sends us an NSWindowDidResignKeyNotification for the old activated
window, then an NSWindowDidBecomeKeyNotificationfor the newly activated
window. Our handling of this would first set Qt's active window to zero,
then immediately reset it afterwards. Avoid this by checking the key
window when handling the deactivation event, and don't set the active
window to zero if a new window has become active.

Task-number: QTBUG-24322
Change-Id: I8719fc501049eeaaebb75e9ea03261b2209458b6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
src/plugins/platforms/cocoa/qnsview.mm
tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp