From b022bece5488c9c43906b1de6989b57f801b2114 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 9 Oct 2014 13:22:46 +0200 Subject: 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 --- src/controls/qquickpopupwindow.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/controls') 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(transientParent())) { // No need for parent menu windows -- cgit v1.2.1