diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index c26e3bc1a8..323456bcc4 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -2344,23 +2343,9 @@ static inline bool isSoftwareGl() } bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message, - WPARAM wParam, LPARAM, LRESULT *result) + WPARAM, LPARAM, LRESULT *result) { if (message == WM_ERASEBKGND) { // Backing store - ignored. - if (!m_firstBgDraw) { - // Get window background from the default palette; this will - // usually be the system background color. - const QColor bgColor = QGuiApplication::palette().color(QPalette::Window); - HBRUSH bgBrush = CreateSolidBrush(RGB(bgColor.red(), bgColor.green(), bgColor.blue())); - // Fill rectangle with system background color - RECT rc; - auto hdc = reinterpret_cast(wParam); - GetClientRect(hwnd, &rc); - FillRect(hdc, &rc, bgBrush); - DeleteObject(bgBrush); - // Brush the window with system background color only for first time - m_firstBgDraw = true; - } *result = 1; return true; } diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 38e9fb9a5b..3404eebf22 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -377,7 +377,6 @@ private: HICON m_iconBig = nullptr; void *m_surface = nullptr; int m_savedDpi = 96; - bool m_firstBgDraw = false; static bool m_screenForGLInitialized;