summaryrefslogtreecommitdiff
path: root/src/controls
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2014-10-09 13:22:46 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2014-10-09 16:04:21 +0200
commitb022bece5488c9c43906b1de6989b57f801b2114 (patch)
tree7a22f00edd9ce39c9de648c28a65272d06688cd5 /src/controls
parentc36f219faaa2a1b89ac19d0822200b163c22eec0 (diff)
downloadqtquickcontrols-b022bece5488c9c43906b1de6989b57f801b2114.tar.gz
QQuickPopupWindow: don't create 1x1 windows
Leave the popup window at its default size until the content size is known instead of squeezing the window down to 1x1. This avoids confusing the XCB platform plugin. It was receiving async native resize events in wrong order so the content height stayed at 1px. Task-number: QTBUG-41617 Task-number: QTBUG-41181 Change-Id: I2dd1312699554dcfe92fbcc6959fb38bbc6a3b46 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/controls')
-rw-r--r--src/controls/qquickpopupwindow.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/controls/qquickpopupwindow.cpp b/src/controls/qquickpopupwindow.cpp
index e10e6ae0..1f4cbcae 100644
--- a/src/controls/qquickpopupwindow.cpp
+++ b/src/controls/qquickpopupwindow.cpp
@@ -84,13 +84,13 @@ void QQuickPopupWindow::show()
posy += offset.y() + parentWindowOffset.y();
}
- if (m_contentItem) {
- qreal initialWidth = qMax(qreal(1), m_contentItem->width());
- qreal initialHeight = qMax(qreal(1), m_contentItem->height());
- setGeometry(posx, posy, initialWidth, initialHeight);
- } else {
+ QSize initialSize;
+ if (m_contentItem)
+ initialSize = QSize(m_contentItem->width(), m_contentItem->height());
+ if (!initialSize.isEmpty())
+ setGeometry(posx, posy, initialSize.width(), initialSize.height());
+ else
setPosition(posx, posy);
- }
emit geometryChanged();
if (!qobject_cast<QQuickPopupWindow *>(transientParent())) { // No need for parent menu windows