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

Side by Side Diff: ui/views/win/hwnd_message_handler.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 | « ui/gfx/win/window_impl.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 <tchar.h> 10 #include <tchar.h>
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 } 342 }
343 343
344 void HWNDMessageHandler::Init(HWND parent, const gfx::Rect& bounds) { 344 void HWNDMessageHandler::Init(HWND parent, const gfx::Rect& bounds) {
345 TRACE_EVENT0("views", "HWNDMessageHandler::Init"); 345 TRACE_EVENT0("views", "HWNDMessageHandler::Init");
346 GetMonitorAndRects(bounds.ToRECT(), &last_monitor_, &last_monitor_rect_, 346 GetMonitorAndRects(bounds.ToRECT(), &last_monitor_, &last_monitor_rect_,
347 &last_work_area_); 347 &last_work_area_);
348 348
349 // Create the window. 349 // Create the window.
350 WindowImpl::Init(parent, bounds); 350 WindowImpl::Init(parent, bounds);
351 351
352 if (delegate_->HasFrame() && base::win::IsProcessPerMonitorDpiAware()) {
353 static auto enable_child_window_dpi_message_func = []() {
354 // Derived signature; not available in headers.
355 // This call gets Windows to scale the non-client area when WM_DPICHANGED
356 // is fired.
357 using EnableChildWindowDpiMessagePtr = LRESULT (WINAPI*)(HWND, BOOL);
358 return reinterpret_cast<EnableChildWindowDpiMessagePtr>(
359 GetProcAddress(GetModuleHandle(L"user32.dll"),
360 "EnableChildWindowDpiMessage"));
361 }();
362 if (enable_child_window_dpi_message_func)
363 enable_child_window_dpi_message_func(hwnd(), TRUE);
364 }
365
352 prop_window_target_.reset(new ui::ViewProp(hwnd(), 366 prop_window_target_.reset(new ui::ViewProp(hwnd(),
353 ui::WindowEventTarget::kWin32InputEventTarget, 367 ui::WindowEventTarget::kWin32InputEventTarget,
354 static_cast<ui::WindowEventTarget*>(this))); 368 static_cast<ui::WindowEventTarget*>(this)));
355 369
356 // Direct Manipulation is enabled on Windows 10+. The CreateInstance function 370 // Direct Manipulation is enabled on Windows 10+. The CreateInstance function
357 // returns NULL if Direct Manipulation is not available. 371 // returns NULL if Direct Manipulation is not available.
358 direct_manipulation_helper_ = 372 direct_manipulation_helper_ =
359 gfx::win::DirectManipulationHelper::CreateInstance(); 373 gfx::win::DirectManipulationHelper::CreateInstance();
360 if (direct_manipulation_helper_) 374 if (direct_manipulation_helper_)
361 direct_manipulation_helper_->Initialize(hwnd()); 375 direct_manipulation_helper_->Initialize(hwnd());
(...skipping 2329 matching lines...) Expand 10 before | Expand all | Expand 10 after
2691 MONITORINFO monitor_info = {sizeof(monitor_info)}; 2705 MONITORINFO monitor_info = {sizeof(monitor_info)};
2692 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), 2706 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY),
2693 &monitor_info); 2707 &monitor_info);
2694 gfx::Rect shrunk_rect(monitor_info.rcMonitor); 2708 gfx::Rect shrunk_rect(monitor_info.rcMonitor);
2695 shrunk_rect.set_height(shrunk_rect.height() - 1); 2709 shrunk_rect.set_height(shrunk_rect.height() - 1);
2696 background_fullscreen_hack_ = true; 2710 background_fullscreen_hack_ = true;
2697 SetBoundsInternal(shrunk_rect, false); 2711 SetBoundsInternal(shrunk_rect, false);
2698 } 2712 }
2699 2713
2700 } // namespace views 2714 } // namespace views
OLDNEW
« no previous file with comments | « ui/gfx/win/window_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698