From a1c37462eebddf4ad7bc3192f1f3e9a3f7292b19 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 13 Mar 2019 11:24:48 +0100 Subject: Windows: Fix tooltip flicker on GL surfaces QPlatformWindow::initialGeometry() would assign a default height to the initial geometry of the QRollEffectClassWindow since it has height of 0. This causes the obtained geometry to not match and subsequently a geometry change being sent synchronously. Introduce a new flag QWindowPrivate::resizeAutomatic similar to the existing QWindowPrivate::positionAutomatic to prevent assigning a default size and pass through the geometry as is where required. Fixes: QTBUG-74176 Change-Id: I70c66490838a2c4dfe200ec86094d28bd984dd03 Reviewed-by: Kati Kankaanpaa Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qwindow_p.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui/kernel/qwindow_p.h') diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index bf5e645114..af1233a9e2 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -90,6 +90,7 @@ public: , receivedExpose(false) , positionPolicy(WindowFrameExclusive) , positionAutomatic(true) + , resizeAutomatic(true) , contentOrientation(Qt::PrimaryOrientation) , opacity(qreal(1.0)) , minimumSize(0, 0) @@ -155,6 +156,8 @@ public: virtual void processSafeAreaMarginsChanged() {}; bool isPopup() const { return (windowFlags & Qt::WindowType_Mask) == Qt::Popup; } + void setAutomaticPositionAndResizeEnabled(bool a) + { positionAutomatic = resizeAutomatic = a; } static QWindowPrivate *get(QWindow *window) { return window->d_func(); } @@ -178,6 +181,7 @@ public: bool receivedExpose; PositionPolicy positionPolicy; bool positionAutomatic; + bool resizeAutomatic; Qt::ScreenOrientation contentOrientation; qreal opacity; QRegion mask; -- cgit v1.2.3 From 2f97a050bc43a7cdbee3219b7cfc4d703ef0a37e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 22 Mar 2019 14:31:07 +0100 Subject: Add explanatory comment to QWindowPrivate::resizeAutomatic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Amends a1c37462eebddf4ad7bc3192f1f3e9a3f7292b19. Task-number: QTBUG-74176 Change-Id: I24fa3e5d88e53e7efb8923fb4c55615a4f90abea Reviewed-by: Tor Arne Vestbø --- src/gui/kernel/qwindow_p.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui/kernel/qwindow_p.h') diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index af1233a9e2..5103d97c6d 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -181,6 +181,10 @@ public: bool receivedExpose; PositionPolicy positionPolicy; bool positionAutomatic; + // resizeAutomatic suppresses resizing by QPlatformWindow::initialGeometry(). + // It also indicates that width/height=0 is acceptable (for example, for + // the QRollEffect widget) and is thus not cleared in setGeometry(). + // An alternative approach might be using -1,-1 as a default size. bool resizeAutomatic; Qt::ScreenOrientation contentOrientation; qreal opacity; -- cgit v1.2.3