From 3a801a667c7c78076fc4aa84e47432ddd4a382a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Mon, 24 Aug 2009 14:00:35 +0200 Subject: Fix QCombobox popup flicker on OS Don't disable updates when showing the popup. This was introduced by commit 5516c2165, the original bug in task 152840 is not reproducible on OS X. Task-number: Reviewed-by: Richard Moe Gustavsen --- src/gui/widgets/qcombobox.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index f04a415fc1..2b6d5dd62b 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -2418,7 +2418,16 @@ void QComboBox::showPopup() && !style->styleHint(QStyle::SH_ComboBox_Popup, &opt, this) && !window()->testAttribute(Qt::WA_DontShowOnScreen)) qScrollEffect(container, scrollDown ? QEffects::DownScroll : QEffects::UpScroll, 150); #endif + +// Don't disable updates on Mac OS X. Windows are displayed immediately on this platform, +// which means that the window will be visible before the call to container->show() returns. +// If updates are disabled at this point we'll miss our chance at painting the popup +// menu before it's shown, causing flicker since the window then displays the standard gray +// background. +#ifndef Q_WS_MAC container->setUpdatesEnabled(false); +#endif + container->raise(); container->show(); container->updateScrollers(); @@ -2429,7 +2438,10 @@ void QComboBox::showPopup() ? QAbstractItemView::PositionAtCenter : QAbstractItemView::EnsureVisible); +#ifndef Q_WS_MAC container->setUpdatesEnabled(updatesEnabled); +#endif + container->update(); } -- cgit v1.2.3