diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-03-13 11:24:48 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-03-21 13:39:51 +0000 |
commit | a1c37462eebddf4ad7bc3192f1f3e9a3f7292b19 (patch) | |
tree | 3547c5ea0860777cea1eb97958c1e9432208cee4 /src/widgets | |
parent | c45f2eab8553a40d7185ed95b4ab3e45e95c8d70 (diff) |
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 <kati.kankaanpaa@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 332eee9c03..2c84ff7161 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1543,14 +1543,19 @@ void QWidgetPrivate::createTLSysExtra() extra->topextra->window->setMaximumSize(QSize(extra->maxw, extra->maxh)); if (extra->topextra->opacity != 255 && q->isWindow()) extra->topextra->window->setOpacity(qreal(extra->topextra->opacity) / qreal(255)); + + const bool isTipLabel = q->inherits("QTipLabel"); + const bool isAlphaWidget = !isTipLabel && q->inherits("QAlphaWidget"); #ifdef Q_OS_WIN // Pass on native parent handle for Widget embedded into Active X. const QVariant activeXNativeParentHandle = q->property(activeXNativeParentHandleProperty); if (activeXNativeParentHandle.isValid()) extra->topextra->window->setProperty(activeXNativeParentHandleProperty, activeXNativeParentHandle); - if (q->inherits("QTipLabel") || q->inherits("QAlphaWidget")) + if (isTipLabel || isAlphaWidget) extra->topextra->window->setProperty("_q_windowsDropShadow", QVariant(true)); #endif + if (isTipLabel || isAlphaWidget || q->inherits("QRollEffect")) + qt_window_private(extra->topextra->window)->setAutomaticPositionAndResizeEnabled(false); } } |