summaryrefslogtreecommitdiffstats
path: root/views/screen_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/screen_win.cc')
-rw-r--r--views/screen_win.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/views/screen_win.cc b/views/screen_win.cc
index 7bfeada..82e95e6 100644
--- a/views/screen_win.cc
+++ b/views/screen_win.cc
@@ -25,6 +25,15 @@ gfx::Rect Screen::GetMonitorWorkAreaNearestWindow(gfx::NativeWindow window) {
}
// static
+gfx::Rect Screen::GetMonitorAreaNearestWindow(gfx::NativeWindow window) {
+ MONITORINFO monitor_info;
+ monitor_info.cbSize = sizeof(monitor_info);
+ GetMonitorInfo(MonitorFromWindow(window, MONITOR_DEFAULTTONEAREST),
+ &monitor_info);
+ return gfx::Rect(monitor_info.rcMonitor);
+}
+
+// static
gfx::Rect Screen::GetMonitorAreaNearestPoint(const gfx::Point& point) {
POINT initial_loc = { point.x(), point.y() };
HMONITOR monitor = MonitorFromPoint(initial_loc, MONITOR_DEFAULTTONEAREST);