Use base::QScreenNearestTo in PipPanel
This commit is contained in:
parent
4fde7852b1
commit
53869ed994
|
@ -30,6 +30,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "styles/style_widgets.h"
|
||||
#include "styles/style_window.h"
|
||||
#include "styles/style_media_view.h"
|
||||
#include "base/qt_adapters.h"
|
||||
|
||||
#include <QtGui/QWindow>
|
||||
#include <QtGui/QScreen>
|
||||
|
@ -48,14 +49,7 @@ constexpr auto kMsInSecond = 1000;
|
|||
}
|
||||
|
||||
[[nodiscard]] QRect ScreenFromPosition(QPoint point) {
|
||||
const auto screen = [&]() -> QScreen* {
|
||||
for (const auto screen : QGuiApplication::screens()) {
|
||||
if (screen->geometry().contains(point)) {
|
||||
return screen;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}();
|
||||
const auto screen = base::QScreenNearestTo(point);
|
||||
const auto use = screen ? screen : QGuiApplication::primaryScreen();
|
||||
return use
|
||||
? use->availableGeometry()
|
||||
|
|
Loading…
Reference in New Issue