diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2014-10-09 13:22:46 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2014-10-09 16:04:21 +0200 |
commit | b022bece5488c9c43906b1de6989b57f801b2114 (patch) | |
tree | 7a22f00edd9ce39c9de648c28a65272d06688cd5 /src/controls/qquickpopupwindow.cpp | |
parent | c36f219faaa2a1b89ac19d0822200b163c22eec0 (diff) | |
download | qtquickcontrols-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/qquickpopupwindow.cpp')
-rw-r--r-- | src/controls/qquickpopupwindow.cpp | 12 |
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 |