mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Beta version 1.9.10: Fix build for OS X 10.10-10.11.
This commit is contained in:
parent
cc71bdce8f
commit
ffeff09561
1 changed files with 8 additions and 1 deletions
|
@ -45,7 +45,14 @@ constexpr auto kMsInSecond = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] QRect ScreenFromPosition(QPoint point) {
|
[[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();
|
const auto use = screen ? screen : QGuiApplication::primaryScreen();
|
||||||
return use
|
return use
|
||||||
? use->availableGeometry()
|
? use->availableGeometry()
|
||||||
|
|
Loading…
Add table
Reference in a new issue