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

Side by Side Diff: ui/gfx/win/window_impl.cc

Issue 2246643002: Only Call EnableChildWindowDpiMessage When Window Has A Frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | ui/views/win/hwnd_message_handler.cc » ('j') | 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/gfx/win/window_impl.h" 5 #include "ui/gfx/win/window_impl.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 height = bounds.height(); 206 height = bounds.height();
207 } 207 }
208 208
209 ATOM atom = GetWindowClassAtom(); 209 ATOM atom = GetWindowClassAtom();
210 bool destroyed = false; 210 bool destroyed = false;
211 destroyed_ = &destroyed; 211 destroyed_ = &destroyed;
212 HWND hwnd = CreateWindowEx(window_ex_style_, 212 HWND hwnd = CreateWindowEx(window_ex_style_,
213 reinterpret_cast<wchar_t*>(atom), NULL, 213 reinterpret_cast<wchar_t*>(atom), NULL,
214 window_style_, x, y, width, height, 214 window_style_, x, y, width, height,
215 parent, NULL, NULL, this); 215 parent, NULL, NULL, this);
216 if (hwnd && base::win::IsProcessPerMonitorDpiAware()) {
217 static auto enable_child_window_dpi_message_func = []() {
218 // Derived signature; not available in headers.
219 // This call gets Windows to scale the non-client area when WM_DPICHANGED
220 // is fired.
221 using EnableChildWindowDpiMessagePtr = LRESULT (WINAPI*)(HWND, BOOL);
222 return reinterpret_cast<EnableChildWindowDpiMessagePtr>(
223 GetProcAddress(GetModuleHandle(L"user32.dll"),
224 "EnableChildWindowDpiMessage"));
225 }();
226 if (enable_child_window_dpi_message_func)
227 enable_child_window_dpi_message_func(hwnd, TRUE);
228 }
229
230 // First nccalcszie (during CreateWindow) for captioned windows is 216 // First nccalcszie (during CreateWindow) for captioned windows is
231 // deliberately ignored so force a second one here to get the right 217 // deliberately ignored so force a second one here to get the right
232 // non-client set up. 218 // non-client set up.
233 if (hwnd && (window_style_ & WS_CAPTION)) { 219 if (hwnd && (window_style_ & WS_CAPTION)) {
234 SetWindowPos(hwnd, NULL, 0, 0, 0, 0, 220 SetWindowPos(hwnd, NULL, 0, 0, 0, 0,
235 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | 221 SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE |
236 SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW); 222 SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
237 } 223 }
238 224
239 if (!hwnd_ && GetLastError() == 0) { 225 if (!hwnd_ && GetLastError() == 0) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 303 }
318 304
319 ATOM WindowImpl::GetWindowClassAtom() { 305 ATOM WindowImpl::GetWindowClassAtom() {
320 HICON icon = GetDefaultWindowIcon(); 306 HICON icon = GetDefaultWindowIcon();
321 HICON small_icon = GetSmallWindowIcon(); 307 HICON small_icon = GetSmallWindowIcon();
322 ClassInfo class_info(initial_class_style(), icon, small_icon); 308 ClassInfo class_info(initial_class_style(), icon, small_icon);
323 return ClassRegistrar::GetInstance()->RetrieveClassAtom(class_info); 309 return ClassRegistrar::GetInstance()->RetrieveClassAtom(class_info);
324 } 310 }
325 311
326 } // namespace gfx 312 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698