From c027f0ae1967ec1d64cb2c9679c8b57f18faf7f5 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Fri, 26 Feb 2010 10:54:41 +0100 Subject: ActiveQt Internet Explorer component causes Desktop Icons to flicker. This happens only if IE is embedded in an frameless window. The repaint caused by calling EnableModeless() is making the desktop icons flicker. This repaint generated via ActiveQt will be ignored by QtGui. This is done by checking if the window style is already in the required state or not. Task-number: QTBUG-8355 Reviewed-by: Denis --- src/gui/kernel/qwidget.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 850e961..91a11ec 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -7925,13 +7925,16 @@ inline void setDisabledStyle(QWidget *w, bool setStyle) // set/reset WS_DISABLED style. if(w && w->isWindow() && w->isVisible() && w->isEnabled()) { LONG dwStyle = GetWindowLong(w->winId(), GWL_STYLE); + LONG newStyle = dwStyle; if (setStyle) - dwStyle |= WS_DISABLED; + newStyle |= WS_DISABLED; else - dwStyle &= ~WS_DISABLED; - SetWindowLong(w->winId(), GWL_STYLE, dwStyle); - // we might need to repaint in some situations (eg. menu) - w->repaint(); + newStyle &= ~WS_DISABLED; + if (newStyle != dwStyle) { + SetWindowLong(w->winId(), GWL_STYLE, newStyle); + // we might need to repaint in some situations (eg. menu) + w->repaint(); + } } } #endif -- cgit v0.12 From 3604c59a93eae6f27407316e5be3840f87d01711 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Fri, 26 Feb 2010 12:12:13 +0100 Subject: Remove unwanted code after c027f0ae1967ec1d64cb2c9679c8b57f18faf7f5 The LockWindowUpdate() was used to reduce the flicker caused when calling EnableModeless(). After the above commit, no repaints will be generated by this code path, so we can remove this call. Task-number: QTBUG-8355 Reviewed-by: Bradley T. Hughes --- src/activeqt/container/qaxwidget.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp index 9149320..865c26c 100644 --- a/src/activeqt/container/qaxwidget.cpp +++ b/src/activeqt/container/qaxwidget.cpp @@ -1438,9 +1438,6 @@ extern Q_GUI_EXPORT bool qt_win_ignoreNextMouseReleaseEvent; HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable) { -#if !defined(Q_OS_WINCE) - LockWindowUpdate(host->window()->winId()); -#endif EnableWindow(host->window()->winId(), fEnable); if (!fEnable) { @@ -1451,9 +1448,6 @@ HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable) QApplicationPrivate::leaveModal(host); } qt_win_ignoreNextMouseReleaseEvent = false; -#if !defined(Q_OS_WINCE) - LockWindowUpdate(0); -#endif return S_OK; } -- cgit v0.12