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/widget/widget_hwnd_utils.h" | 5 #include "ui/views/widget/widget_hwnd_utils.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 // and the desktop background. The handshake is as follows: | 56 // and the desktop background. The handshake is as follows: |
57 // 1- Use D3D9Ex to create device/swapchain, etc. You need D3DFMT_A8R8G8B8. | 57 // 1- Use D3D9Ex to create device/swapchain, etc. You need D3DFMT_A8R8G8B8. |
58 // 2- The window must have WS_EX_COMPOSITED in the extended style. | 58 // 2- The window must have WS_EX_COMPOSITED in the extended style. |
59 // 3- The window must have WS_POPUP in its style. | 59 // 3- The window must have WS_POPUP in its style. |
60 // 4- The windows must not have WM_SIZEBOX, WS_THICKFRAME or WS_CAPTION in its | 60 // 4- The windows must not have WM_SIZEBOX, WS_THICKFRAME or WS_CAPTION in its |
61 // style. | 61 // style. |
62 // 5- When the window is created but before it is presented, call | 62 // 5- When the window is created but before it is presented, call |
63 // DwmExtendFrameIntoClientArea passing -1 as the margins. | 63 // DwmExtendFrameIntoClientArea passing -1 as the margins. |
64 if (params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW) { | 64 if (params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW) { |
65 #if defined(USE_AURA) | 65 #if defined(USE_AURA) |
66 if (ui::win::IsAeroGlassEnabled()) | 66 if (ui::win::IsAeroGlassEnabled()) { |
67 *ex_style |= WS_EX_COMPOSITED; | 67 *ex_style |= WS_EX_COMPOSITED; |
68 } else { | |
69 // In classic mode, the WS_EX_TRANSPARENT style causes the window to not | |
70 // paint correctly. | |
71 *ex_style &= ~WS_EX_TRANSPARENT; | |
sky
2013/09/06 21:03:47
Won't this cause bad things to happen where we are
ananta
2013/09/06 21:23:26
The HWNDMessageHandler::SetInitialFocus function i
ananta
2013/09/06 22:08:50
As per our discussion we pass in accept_events = t
| |
72 } | |
68 #else | 73 #else |
69 *ex_style |= WS_EX_LAYERED; | 74 *ex_style |= WS_EX_LAYERED; |
70 #endif | 75 #endif |
71 } | 76 } |
72 if (params.has_dropshadow) { | 77 if (params.has_dropshadow) { |
73 *class_style |= (base::win::GetVersion() < base::win::VERSION_XP) ? | 78 *class_style |= (base::win::GetVersion() < base::win::VERSION_XP) ? |
74 0 : CS_DROPSHADOW; | 79 0 : CS_DROPSHADOW; |
75 } | 80 } |
76 | 81 |
77 // Set type-dependent style attributes. | 82 // Set type-dependent style attributes. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
153 DWORD class_style = 0; | 158 DWORD class_style = 0; |
154 CalculateWindowStylesFromInitParams(params, widget_delegate, | 159 CalculateWindowStylesFromInitParams(params, widget_delegate, |
155 native_widget_delegate, &style, &ex_style, | 160 native_widget_delegate, &style, &ex_style, |
156 &class_style); | 161 &class_style); |
157 handler->set_initial_class_style(class_style); | 162 handler->set_initial_class_style(class_style); |
158 handler->set_window_style(handler->window_style() | style); | 163 handler->set_window_style(handler->window_style() | style); |
159 handler->set_window_ex_style(handler->window_ex_style() | ex_style); | 164 handler->set_window_ex_style(handler->window_ex_style() | ex_style); |
160 } | 165 } |
161 | 166 |
162 } // namespace views | 167 } // namespace views |
OLD | NEW |