Cocoa: Re-implement QCocoaScreen::topLevelAt()
authorMorten Johan Sørvig <morten.sorvig@digia.com>
Wed, 4 Jun 2014 08:06:28 +0000 (10:06 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 6 Jun 2014 21:39:12 +0000 (23:39 +0200)
commit7eba6d039dfbb9377a4358842fcd7210dc1fdd86
treea8f239872030fcf8ab896f6550b7ffe805907284
parent0af887124a05eecc2b649c93f8189d87ba669e36
Cocoa: Re-implement QCocoaScreen::topLevelAt()

The previous implementation used [NSApp orderedWindows]
which does not return NSPanel subclasses, which is
used by Qt dialogs and pops.

Use [NSWidow windowNumberAtPoint:belowWindowWithWindowNumber]
instead, which hit-tests on all window types. This
can potentially include windows from other processes
and non-Qt windows which needs to be filtered out.

Add EXPECT_FAIL to tst_MacGui::nonModalOrder. The
correct topLevelAt() implementation now exposes that
this test is failing.

Task-number: QTBUG-39322
Change-Id: I81afa3da964e08fe682802220d8fe81e9284205e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
src/plugins/platforms/cocoa/qcocoaintegration.mm
tests/auto/other/macgui/tst_macgui.cpp