Skip to content

Commit

Permalink
macOS: Remove assert that primary display always matches CGMainDisplayID
Browse files Browse the repository at this point in the history
Fixes: QTBUG-78707
Change-Id: Ia517f543728c76dcf19558e9e68ed97db7cfaaa4
Reviewed-by: Timur Pocheptsov <[email protected]>
  • Loading branch information
torarnv committed Oct 27, 2019
1 parent 48603ba commit 22c3fd0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugins/platforms/cocoa/qcocoascreen.mm
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,10 @@ void flushOutput() {
*/
QCocoaScreen *QCocoaScreen::primaryScreen()
{
auto screen = static_cast<QCocoaScreen *>(QGuiApplication::primaryScreen()->handle());
Q_ASSERT_X(screen == get(CGMainDisplayID()), "QCocoaScreen",
"The application's primary screen should always be in sync with the main display");
return screen;
// Note: The primary screen that Qt knows about may not match the current CGMainDisplayID()
// if macOS has not yet been able to inform us that the main display has changed, but we
// will update the primary screen accordingly once the reconfiguration callback comes in.
return static_cast<QCocoaScreen *>(QGuiApplication::primaryScreen()->handle());
}

QList<QPlatformScreen*> QCocoaScreen::virtualSiblings() const
Expand Down

0 comments on commit 22c3fd0

Please sign in to comment.