summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/base/win/window_impl.cc3
-rw-r--r--ui/views/win/hwnd_message_handler.cc15
-rw-r--r--ui/views/win/hwnd_message_handler.h3
3 files changed, 18 insertions, 3 deletions
diff --git a/ui/base/win/window_impl.cc b/ui/base/win/window_impl.cc
index 5797d4c..22ed535 100644
--- a/ui/base/win/window_impl.cc
+++ b/ui/base/win/window_impl.cc
@@ -100,7 +100,6 @@ ATOM ClassRegistrar::RetrieveClassAtom(const ClassInfo& class_info) {
string16 name = string16(WindowImpl::kBaseClassName) +
base::IntToString16(registered_count_++);
- HBRUSH background = reinterpret_cast<HBRUSH>(COLOR_WINDOW);
WNDCLASSEX window_class;
base::win::InitializeWindowClass(
name.c_str(),
@@ -109,7 +108,7 @@ ATOM ClassRegistrar::RetrieveClassAtom(const ClassInfo& class_info) {
0,
0,
NULL,
- reinterpret_cast<HBRUSH>(background + 1),
+ NULL,
NULL,
class_info.icon,
class_info.icon,
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index e998dff..07f53e4 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -394,7 +394,8 @@ HWNDMessageHandler::HWNDMessageHandler(HWNDMessageHandlerDelegate* delegate)
can_update_layered_window_(true),
is_first_nccalc_(true),
autohide_factory_(this),
- touch_event_factory_(this) {
+ touch_event_factory_(this),
+ did_gdi_clear_(false) {
}
HWNDMessageHandler::~HWNDMessageHandler() {
@@ -1359,6 +1360,18 @@ void HWNDMessageHandler::OnEnterSizeMove() {
}
LRESULT HWNDMessageHandler::OnEraseBkgnd(HDC dc) {
+ if (!did_gdi_clear_) {
+ // This is necessary (at least on Win8) to avoid white flashing in the
+ // titlebar area around the minimize/maximize/close buttons.
+ HDC dc = GetDC(hwnd());
+ RECT client_rect;
+ GetClientRect(hwnd(), &client_rect);
+ HBRUSH brush = CreateSolidBrush(0);
+ FillRect(dc, &client_rect, brush);
+ DeleteObject(brush);
+ ReleaseDC(hwnd(), dc);
+ did_gdi_clear_ = true;
+ }
// Needed to prevent resize flicker.
return 1;
}
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
index 80ad4aa..67ef0b6 100644
--- a/ui/views/win/hwnd_message_handler.h
+++ b/ui/views/win/hwnd_message_handler.h
@@ -481,6 +481,9 @@ class VIEWS_EXPORT HWNDMessageHandler :
// A factory that allows us to process touch events asynchronously.
base::WeakPtrFactory<HWNDMessageHandler> touch_event_factory_;
+ // Necessary to avoid corruption on NC paint in Aero mode.
+ bool did_gdi_clear_;
+
DISALLOW_COPY_AND_ASSIGN(HWNDMessageHandler);
};