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
This commit is contained in:
Sergio Martins
2022-10-28 12:08:38 +01:00
parent 0d943620ac
commit 35bf7bc9c8

View File

@@ -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))