mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 07:33:52 +02:00
Synchronize PiP's screen detection code with media viewer
This commit is contained in:
parent
a943a993cb
commit
3967e5d4ff
1 changed files with 10 additions and 1 deletions
|
@ -464,7 +464,16 @@ PipPanel::Position PipPanel::countPosition() const {
|
||||||
|
|
||||||
void PipPanel::setPositionDefault() {
|
void PipPanel::setPositionDefault() {
|
||||||
const auto widgetScreen = [&](auto &&widget) -> QScreen* {
|
const auto widgetScreen = [&](auto &&widget) -> QScreen* {
|
||||||
if (auto handle = widget ? widget->windowHandle() : nullptr) {
|
if (!widget) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
if (!Platform::IsWayland()) {
|
||||||
|
if (const auto screen = QGuiApplication::screenAt(
|
||||||
|
widget->geometry().center())) {
|
||||||
|
return screen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (const auto handle = widget->windowHandle()) {
|
||||||
return handle->screen();
|
return handle->screen();
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
Loading…
Add table
Reference in a new issue