diff --git a/Telegram/SourceFiles/media/view/media_view_pip.cpp b/Telegram/SourceFiles/media/view/media_view_pip.cpp index 44d4b9b114..3cc1c04ddb 100644 --- a/Telegram/SourceFiles/media/view/media_view_pip.cpp +++ b/Telegram/SourceFiles/media/view/media_view_pip.cpp @@ -464,7 +464,16 @@ PipPanel::Position PipPanel::countPosition() const { void PipPanel::setPositionDefault() { 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 nullptr;