OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/host/ash_window_tree_host_x11.h" | 5 #include "ash/host/ash_window_tree_host_x11.h" |
6 | 6 |
7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
10 #include <X11/extensions/Xfixes.h> | 10 #include <X11/extensions/Xfixes.h> |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 xiev->deviceid); | 211 xiev->deviceid); |
212 // If we don't have record of display id for this touch device, check | 212 // If we don't have record of display id for this touch device, check |
213 // that if the event is within the bound of the root window. Note | 213 // that if the event is within the bound of the root window. Note |
214 // that in multi-monitor case, the event position is in framebuffer | 214 // that in multi-monitor case, the event position is in framebuffer |
215 // space so the bounds check will not work so well. | 215 // space so the bounds check will not work so well. |
216 if (touch_display_id == gfx::Display::kInvalidDisplayID) { | 216 if (touch_display_id == gfx::Display::kInvalidDisplayID) { |
217 if (base::SysInfo::IsRunningOnChromeOS() && | 217 if (base::SysInfo::IsRunningOnChromeOS() && |
218 !bounds().Contains(ui::EventLocationFromNative(xev))) | 218 !bounds().Contains(ui::EventLocationFromNative(xev))) |
219 return false; | 219 return false; |
220 } else { | 220 } else { |
221 gfx::Screen* screen = gfx::Screen::GetScreenFor(window()); | 221 gfx::Screen* screen = gfx::Screen::GetScreen(); |
222 gfx::Display display = screen->GetDisplayNearestWindow(window()); | 222 gfx::Display display = screen->GetDisplayNearestWindow(window()); |
223 return touch_display_id == display.id(); | 223 return touch_display_id == display.id(); |
224 } | 224 } |
225 #endif // defined(OS_CHROMEOS) | 225 #endif // defined(OS_CHROMEOS) |
226 return true; | 226 return true; |
227 } | 227 } |
228 default: | 228 default: |
229 return true; | 229 return true; |
230 } | 230 } |
231 } | 231 } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 #endif | 291 #endif |
292 | 292 |
293 AshWindowTreeHost* AshWindowTreeHost::Create( | 293 AshWindowTreeHost* AshWindowTreeHost::Create( |
294 const AshWindowTreeHostInitParams& init_params) { | 294 const AshWindowTreeHostInitParams& init_params) { |
295 if (init_params.offscreen) | 295 if (init_params.offscreen) |
296 return new AshWindowTreeHostUnified(init_params.initial_bounds); | 296 return new AshWindowTreeHostUnified(init_params.initial_bounds); |
297 return new AshWindowTreeHostX11(init_params.initial_bounds); | 297 return new AshWindowTreeHostX11(init_params.initial_bounds); |
298 } | 298 } |
299 | 299 |
300 } // namespace ash | 300 } // namespace ash |
OLD | NEW |