Fix getting the screen of viewer/pip

We need to workaround getting the actual screen for the parent by getting its position yet we need to get the setted screen for the widget itself as that's the screen used to compute the geometry
This commit is contained in:
Ilya Fedin 2023-10-22 22:02:38 +04:00 committed by John Preston
parent fde63ccb21
commit eb1ef6d2a7
2 changed files with 3 additions and 3 deletions

View File

@ -817,7 +817,7 @@ void OverlayWidget::moveToScreen(bool inMove) {
? Core::App().activeWindow()->widget().get()
: nullptr;
const auto activeWindowScreen = widgetScreen(applicationWindow);
const auto myScreen = widgetScreen(_window);
const auto myScreen = _window->screen();
if (activeWindowScreen && myScreen != activeWindowScreen) {
const auto screenList = QGuiApplication::screens();
DEBUG_LOG(("Viewer Pos: Currently on screen %1, moving to screen %2")

View File

@ -514,8 +514,8 @@ void PipPanel::setPositionDefault() {
return widget->screen();
};
const auto parentScreen = widgetScreen(_parent);
const auto myScreen = widgetScreen(widget());
if (parentScreen && myScreen && myScreen != parentScreen) {
const auto myScreen = widget()->screen();
if (parentScreen && myScreen != parentScreen) {
widget()->windowHandle()->setScreen(parentScreen);
}
auto position = Position();