Keep the dockwidget with the mouse when moving to another screen
When you move a dockwidget from one screen to another then it needs to be kept at the same position on the new screen, i.e. with the mouse pointer. This fix ensures that this is happening including when the screens may not 100% align up with each other. Task-number: QTBUG-33369 Change-Id: If414effdd0e0415629ca31a86f8bbe382dd29f80 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
This commit is contained in:
parent
e1c0a1b56c
commit
f3a4bc17ab
@ -599,7 +599,17 @@ NSRect qt_mac_flipRect(const QRect &rect, QWindow *window)
|
||||
{
|
||||
QPlatformScreen *onScreen = QPlatformScreen::platformScreenForWindow(window);
|
||||
int flippedY = onScreen->geometry().height() - (rect.y() + rect.height());
|
||||
|
||||
QList<QScreen *> screens = QGuiApplication::screens();
|
||||
if (screens.size() > 1) {
|
||||
int height = 0;
|
||||
foreach (QScreen *scr, screens)
|
||||
height = qMax(height, scr->size().height());
|
||||
int difference = height - onScreen->geometry().height();
|
||||
if (difference > 0)
|
||||
flippedY += difference;
|
||||
else
|
||||
flippedY -= difference;
|
||||
}
|
||||
// In case of automatic positioning, try to put as much of the window onscreen as possible.
|
||||
if (window->isTopLevel() && qt_window_private(const_cast<QWindow*>(window))->positionAutomatic && flippedY < 0)
|
||||
flippedY = onScreen->geometry().height() - onScreen->availableGeometry().height() - onScreen->availableGeometry().y();
|
||||
|
Loading…
x
Reference in New Issue
Block a user