From 984094a7ffb5807e23b146fb155671d6e8840a16 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 20 Jun 2022 23:54:14 +0400 Subject: [PATCH] Partially revert "Use QWidget::screen/QWidget::mask instead of QWindow ones" This partially reverts commit e5d8a1aa3c9457c0c0ceb560190a19d7b5349d9d to use QWindow::setScreen. --- .../calls/group/ui/desktop_capture_choose_source.cpp | 3 ++- Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp b/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp index c19b352c4..249696f8b 100644 --- a/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp +++ b/Telegram/SourceFiles/calls/group/ui/desktop_capture_choose_source.cpp @@ -574,6 +574,7 @@ void ChooseSourceProcess::setupSourcesGeometry() { void ChooseSourceProcess::setupGeometryWithParent( not_null parent) { + _window->createWinId(); const auto parentScreen = [&] { if (!::Platform::IsWayland()) { if (const auto screen = QGuiApplication::screenAt( @@ -585,7 +586,7 @@ void ChooseSourceProcess::setupGeometryWithParent( }(); const auto myScreen = _window->screen(); if (parentScreen && myScreen != parentScreen) { - _window->setScreen(parentScreen); + _window->windowHandle()->setScreen(parentScreen); } _window->move( parent->x() + (parent->width() - _window->width()) / 2, diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 1a20b8fc7..a067d3525 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -501,7 +501,7 @@ void OverlayWidget::moveToScreen(bool inMove) { DEBUG_LOG(("Viewer Pos: Currently on screen %1, moving to screen %2") .arg(screenList.indexOf(myScreen)) .arg(screenList.indexOf(activeWindowScreen))); - _widget->setScreen(activeWindowScreen); + window()->setScreen(activeWindowScreen); DEBUG_LOG(("Viewer Pos: New actual screen: %1") .arg(screenList.indexOf(_widget->screen()))); }