Beta version 1.9.10: Fix build for OS X 10.10-10.11.

This commit is contained in:
John Preston 2020-02-05 22:03:42 +04:00
parent cc71bdce8f
commit ffeff09561
1 changed files with 8 additions and 1 deletions

View File

@ -45,7 +45,14 @@ constexpr auto kMsInSecond = 1000;
}
[[nodiscard]] QRect ScreenFromPosition(QPoint point) {
const auto screen = QGuiApplication::screenAt(point);
const auto screen = [&]() -> QScreen* {
for (const auto screen : QGuiApplication::screens()) {
if (screen->virtualGeometry().contains(point)) {dD
return screen;
}
}
return nullptr;
}();
const auto use = screen ? screen : QGuiApplication::primaryScreen();
return use
? use->availableGeometry()