Implement a system that resizes the ghost widget appropriately to avoid undefined behavior due to it being moved into the gap between screens caused by scaling.

Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
This commit is contained in:
Danilo Aimini
2021-09-14 20:11:00 -07:00
parent ce72e32cfc
commit 81bd7b1f5f
3 changed files with 65 additions and 8 deletions
@@ -1615,14 +1615,16 @@ namespace AzQtComponents
}
// Handle snapping to the screen edges/other floating windows while dragging
QScreen* screen = Utilities::ScreenAtPoint(globalPos);
QScreen* screen = QApplication::screenAt(globalPos);
AdjustForSnapping(placeholder, screen);
if (screen)
{
AdjustForSnapping(placeholder, screen);
m_state.setPlaceholder(placeholder, screen);
m_state.setPlaceholder(placeholder, screen);
m_ghostWidget->Enable();
RepaintFloatingIndicators();
m_ghostWidget->Enable();
RepaintFloatingIndicators();
}
}
return m_dropZoneState.dragging();