Windows: Mark window margins as dirty when the theme changes.

Task-number: QTBUG-31523

Change-Id: Ibd8ed4e3fc5b6d1723f94dc32b3bf86b74e71020
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Friedemann Kleint 2013-07-23 11:40:43 +02:00 committed by The Qt Project
parent bd602a2dc4
commit 0edf1390ca

View File

@ -848,10 +848,15 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
case QtWindows::CloseEvent: case QtWindows::CloseEvent:
QWindowSystemInterface::handleCloseEvent(platformWindow->window()); QWindowSystemInterface::handleCloseEvent(platformWindow->window());
return true; return true;
case QtWindows::ThemeChanged: // ### fixme: Compress these events? case QtWindows::ThemeChanged: {
// Switch from Aero to Classic changes margins.
const Qt::WindowFlags flags = platformWindow->window()->flags();
if ((flags & Qt::WindowType_Mask) != Qt::Desktop && !(flags & Qt::FramelessWindowHint))
platformWindow->setFlag(QWindowsWindow::FrameDirty);
if (QWindowsTheme *theme = QWindowsTheme::instance()) if (QWindowsTheme *theme = QWindowsTheme::instance())
theme->windowsThemeChanged(platformWindow->window()); theme->windowsThemeChanged(platformWindow->window());
return true; return true;
}
#ifndef Q_OS_WINCE #ifndef Q_OS_WINCE
case QtWindows::ActivateWindowEvent: case QtWindows::ActivateWindowEvent:
if (platformWindow->testFlag(QWindowsWindow::BlockedByModal)) if (platformWindow->testFlag(QWindowsWindow::BlockedByModal))