Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(851)

Side by Side Diff: ui/views/win/hwnd_message_handler.cc

Issue 440793002: Fix the painting problems seen in the tabstrip when switching from a theme to glass on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed debugging code Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/renderer_host/legacy_render_widget_host_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/win/hwnd_message_handler.h" 5 #include "ui/views/win/hwnd_message_handler.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 #include <oleacc.h> 8 #include <oleacc.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <wtsapi32.h> 10 #include <wtsapi32.h>
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 if (IsVisible() && !delegate_->IsUsingCustomFrame()) { 808 if (IsVisible() && !delegate_->IsUsingCustomFrame()) {
809 // For some reason, we need to hide the window after we change from a custom 809 // For some reason, we need to hide the window after we change from a custom
810 // frame to a native frame. If we don't, the client area will be filled 810 // frame to a native frame. If we don't, the client area will be filled
811 // with black. This seems to be related to an interaction between DWM and 811 // with black. This seems to be related to an interaction between DWM and
812 // SetWindowRgn, but the details aren't clear. Additionally, we need to 812 // SetWindowRgn, but the details aren't clear. Additionally, we need to
813 // specify SWP_NOZORDER here, otherwise if you have multiple chrome windows 813 // specify SWP_NOZORDER here, otherwise if you have multiple chrome windows
814 // open they will re-appear with a non-deterministic Z-order. 814 // open they will re-appear with a non-deterministic Z-order.
815 UINT flags = SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER; 815 UINT flags = SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER;
816 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); 816 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW);
817 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); 817 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW);
818 // Invalidate the window to force a paint. There may be child windows which
819 // could resize in this context. Don't paint right away.
820 ::InvalidateRect(hwnd(), NULL, FALSE);
821 } 818 }
822 819
823 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want 820 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want
824 // to notify our children too, since we can have MDI child windows who need to 821 // to notify our children too, since we can have MDI child windows who need to
825 // update their appearance. 822 // update their appearance.
826 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); 823 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL);
827 } 824 }
828 825
829 void HWNDMessageHandler::SchedulePaintInRect(const gfx::Rect& rect) { 826 void HWNDMessageHandler::SchedulePaintInRect(const gfx::Rect& rect) {
830 if (use_layered_buffer_) { 827 if (use_layered_buffer_) {
(...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after
2437 POINT cursor_pos = {0}; 2434 POINT cursor_pos = {0};
2438 ::GetCursorPos(&cursor_pos); 2435 ::GetCursorPos(&cursor_pos);
2439 if (memcmp(&cursor_pos, &mouse_location, sizeof(POINT))) 2436 if (memcmp(&cursor_pos, &mouse_location, sizeof(POINT)))
2440 return false; 2437 return false;
2441 return true; 2438 return true;
2442 } 2439 }
2443 return false; 2440 return false;
2444 } 2441 }
2445 2442
2446 } // namespace views 2443 } // namespace views
OLDNEW
« no previous file with comments | « content/browser/renderer_host/legacy_render_widget_host_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698