Partially revert "Use QWidget::screen/QWidget::mask instead of QWindow ones"

This partially reverts commit e5d8a1aa3c to use QWindow::setScreen.
This commit is contained in:
Ilya Fedin 2022-06-20 23:54:14 +04:00 committed by John Preston
parent 55285f327a
commit 984094a7ff
2 changed files with 3 additions and 2 deletions

View File

@ -574,6 +574,7 @@ void ChooseSourceProcess::setupSourcesGeometry() {
void ChooseSourceProcess::setupGeometryWithParent(
not_null<QWidget*> 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,

View File

@ -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())));
}