widget: clear WA_OutsideWSRange when needed in QWidgetPrivate::create()

which follows the behavior in QWidgetPrivate::setGeometry_sys().

Pick-to: 6.9 6.8
Fixes: QTBUG-129698
Change-Id: Ia85e9470111eea9e3392cdf38c3da2db232ef065
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Liang Qi 2024-10-07 09:44:56 +02:00
parent 190c85b706
commit def4f827da

View File

@ -1401,9 +1401,12 @@ void QWidgetPrivate::create()
if (data.crect.width() == 0 || data.crect.height() == 0) {
q->setAttribute(Qt::WA_OutsideWSRange, true);
} else if (q->isVisible()) {
// If widget is already shown, set window visible, too
win->setNativeWindowVisibility(true);
} else {
q->setAttribute(Qt::WA_OutsideWSRange, false);
if (q->isVisible()) {
// If widget is already shown, set window visible, too
win->setNativeWindowVisibility(true);
}
}
}