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/display/win/screen_win.h" | 5 #include "ui/display/win/screen_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellscalingapi.h> | 8 #include <shellscalingapi.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 } | 481 } |
482 | 482 |
483 int ScreenWin::GetSystemMetrics(int metric) const { | 483 int ScreenWin::GetSystemMetrics(int metric) const { |
484 return ::GetSystemMetrics(metric); | 484 return ::GetSystemMetrics(metric); |
485 } | 485 } |
486 | 486 |
487 void ScreenWin::OnWndProc(HWND hwnd, | 487 void ScreenWin::OnWndProc(HWND hwnd, |
488 UINT message, | 488 UINT message, |
489 WPARAM wparam, | 489 WPARAM wparam, |
490 LPARAM lparam) { | 490 LPARAM lparam) { |
491 if (message != WM_DISPLAYCHANGE) | 491 if (message != WM_DISPLAYCHANGE && |
| 492 !(message == WM_SETTINGCHANGE && wparam == SPI_SETWORKAREA)) |
492 return; | 493 return; |
493 | 494 |
494 std::vector<Display> old_displays = std::move(displays_); | 495 std::vector<Display> old_displays = std::move(displays_); |
495 UpdateFromDisplayInfos(GetDisplayInfosFromSystem()); | 496 UpdateFromDisplayInfos(GetDisplayInfosFromSystem()); |
496 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); | 497 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); |
497 } | 498 } |
498 | 499 |
499 ScreenWinDisplay ScreenWin::GetScreenWinDisplayNearestHWND(HWND hwnd) | 500 ScreenWinDisplay ScreenWin::GetScreenWinDisplayNearestHWND(HWND hwnd) |
500 const { | 501 const { |
501 return GetScreenWinDisplay(MonitorInfoFromWindow(hwnd, | 502 return GetScreenWinDisplay(MonitorInfoFromWindow(hwnd, |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 if (std::find(unique_scale_factors.begin(), unique_scale_factors.end(), | 593 if (std::find(unique_scale_factors.begin(), unique_scale_factors.end(), |
593 reported_scale) == unique_scale_factors.end()) { | 594 reported_scale) == unique_scale_factors.end()) { |
594 unique_scale_factors.push_back(reported_scale); | 595 unique_scale_factors.push_back(reported_scale); |
595 UMA_HISTOGRAM_SPARSE_SLOWLY("UI.DeviceScale", reported_scale); | 596 UMA_HISTOGRAM_SPARSE_SLOWLY("UI.DeviceScale", reported_scale); |
596 } | 597 } |
597 } | 598 } |
598 } | 599 } |
599 | 600 |
600 } // namespace win | 601 } // namespace win |
601 } // namespace display | 602 } // namespace display |
OLD | NEW |