From 35bf7bc9c8db0e43a0d6611c635846f9a589c453 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Fri, 28 Oct 2022 12:08:38 +0100 Subject: [PATCH] Fix moving floating windows to negative positions QScreen::geometry() is already in "virtual coordinate space", no need to map again. Bug wasn't noticeable since most setups have virtual top left at 0,0, so it was a no-op in most cases. Fixes bug #321 --- src/private/FloatingWindow.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/private/FloatingWindow.cpp b/src/private/FloatingWindow.cpp index 5552c6d0..2afc68d0 100644 --- a/src/private/FloatingWindow.cpp +++ b/src/private/FloatingWindow.cpp @@ -760,10 +760,7 @@ void FloatingWindow::ensureRectIsOnScreen(QRect &geometry) const int screenCount = screens.count(); for (int i = 0; i < screenCount; i++) { - auto scrGeom = screens[i]->geometry(); - - // Account for virtual coordinates space - scrGeom.moveTopLeft(scrGeom.topLeft() - screens[i]->virtualGeometry().topLeft()); + const QRect scrGeom = screens[i]->geometry(); // If the rectangle is visible at all, we need do nothing if (scrGeom.intersects(geometry))