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

Side by Side Diff: ui/display/win/screen_win.cc

Issue 2829693003: Fix stale display work_area on windows (Closed)
Patch Set: Fix stale display work_area on windows Created 3 years, 7 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 | 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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698