QWindow: avoid extra window resize on changing min/max sizes
Amends e7477e8934.
Do not call QWindow::resize() on changing min/max sizes if
bounded window size has not changed. Otherwise it may unexpectedly
reset window's state on some platforms, like Windows and Linux.
Fixes: QTBUG-115699
Pick-to: 6.5 6.6
Change-Id: I217ca3fd854a1f41d6df312e3258734d1d3bce45
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
parent
63eaa3a989
commit
7efc0f6f19
|
|
@ -612,7 +612,10 @@ void QWindowPrivate::setMinOrMaxSize(QSize *oldSizeMember, const QSize &size,
|
|||
// resize window if current size is outside of min and max limits
|
||||
if (minimumSize.width() <= maximumSize.width()
|
||||
|| minimumSize.height() <= maximumSize.height()) {
|
||||
q->resize(q->geometry().size().expandedTo(minimumSize).boundedTo(maximumSize));
|
||||
const QSize currentSize = q->size();
|
||||
const QSize boundedSize = currentSize.expandedTo(minimumSize).boundedTo(maximumSize);
|
||||
if (currentSize != boundedSize)
|
||||
q->resize(boundedSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue