| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |