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/views/widget/desktop_aura/desktop_screen_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_screen_x11.h" |
6 | 6 |
7 #include <X11/extensions/Xrandr.h> | 7 #include <X11/extensions/Xrandr.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 | 9 |
10 // It clashes with out RootWindow. | 10 // It clashes with out RootWindow. |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 &child, | 142 &child, |
143 &root_x, | 143 &root_x, |
144 &root_y, | 144 &root_y, |
145 &win_x, | 145 &win_x, |
146 &win_y, | 146 &win_y, |
147 &mask); | 147 &mask); |
148 | 148 |
149 return PixelToDIPPoint(gfx::Point(root_x, root_y)); | 149 return PixelToDIPPoint(gfx::Point(root_x, root_y)); |
150 } | 150 } |
151 | 151 |
152 gfx::NativeWindow DesktopScreenX11::GetWindowUnderCursor() { | 152 bool DesktopScreenX11::IsWindowUnderCursor(gfx::NativeWindow window) { |
153 return GetWindowAtScreenPoint(GetCursorScreenPoint()); | 153 return GetWindowAtScreenPoint(GetCursorScreenPoint()) == window; |
154 } | 154 } |
155 | 155 |
156 gfx::NativeWindow DesktopScreenX11::GetWindowAtScreenPoint( | 156 gfx::NativeWindow DesktopScreenX11::GetWindowAtScreenPoint( |
157 const gfx::Point& point) { | 157 const gfx::Point& point) { |
158 X11TopmostWindowFinder finder; | 158 X11TopmostWindowFinder finder; |
159 return finder.FindLocalProcessWindowAt( | 159 return finder.FindLocalProcessWindowAt( |
160 DIPToPixelPoint(point), std::set<aura::Window*>()); | 160 DIPToPixelPoint(point), std::set<aura::Window*>()); |
161 } | 161 } |
162 | 162 |
163 int DesktopScreenX11::GetNumDisplays() const { | 163 int DesktopScreenX11::GetNumDisplays() const { |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 GetPrimaryDisplay().device_scale_factor()); | 389 GetPrimaryDisplay().device_scale_factor()); |
390 } | 390 } |
391 | 391 |
392 //////////////////////////////////////////////////////////////////////////////// | 392 //////////////////////////////////////////////////////////////////////////////// |
393 | 393 |
394 display::Screen* CreateDesktopScreen() { | 394 display::Screen* CreateDesktopScreen() { |
395 return new DesktopScreenX11; | 395 return new DesktopScreenX11; |
396 } | 396 } |
397 | 397 |
398 } // namespace views | 398 } // namespace views |
OLD | NEW |