| 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/extensions/Xfixes.h> | 7 #include <X11/extensions/Xfixes.h> |
| 8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
| 9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
| 10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 SendEventToProcessor(event); | 240 SendEventToProcessor(event); |
| 241 } | 241 } |
| 242 | 242 |
| 243 #if defined(OS_CHROMEOS) | 243 #if defined(OS_CHROMEOS) |
| 244 void AshWindowTreeHostX11::SetCrOSTapPaused(bool state) { | 244 void AshWindowTreeHostX11::SetCrOSTapPaused(bool state) { |
| 245 if (!ui::IsXInput2Available()) | 245 if (!ui::IsXInput2Available()) |
| 246 return; | 246 return; |
| 247 // Temporarily pause tap-to-click when the cursor is hidden. | 247 // Temporarily pause tap-to-click when the cursor is hidden. |
| 248 Atom prop = atom_cache()->GetAtom("Tap Paused"); | 248 Atom prop = atom_cache()->GetAtom("Tap Paused"); |
| 249 unsigned char value = state; | 249 unsigned char value = state; |
| 250 XIDeviceList dev_list = | 250 const XIDeviceList& dev_list = |
| 251 ui::DeviceListCacheX11::GetInstance()->GetXI2DeviceList(xdisplay()); | 251 ui::DeviceListCacheX11::GetInstance()->GetXI2DeviceList(xdisplay()); |
| 252 | 252 |
| 253 // Only slave pointer devices could possibly have tap-paused property. | 253 // Only slave pointer devices could possibly have tap-paused property. |
| 254 for (int i = 0; i < dev_list.count; i++) { | 254 for (int i = 0; i < dev_list.count; i++) { |
| 255 if (dev_list[i].use == XISlavePointer) { | 255 if (dev_list[i].use == XISlavePointer) { |
| 256 Atom old_type; | 256 Atom old_type; |
| 257 int old_format; | 257 int old_format; |
| 258 unsigned long old_nvalues, bytes; | 258 unsigned long old_nvalues, bytes; |
| 259 unsigned char* data; | 259 unsigned char* data; |
| 260 int result = XIGetProperty(xdisplay(), | 260 int result = XIGetProperty(xdisplay(), |
| (...skipping 23 matching lines...) Expand all Loading... |
| 284 } | 284 } |
| 285 } | 285 } |
| 286 #endif | 286 #endif |
| 287 | 287 |
| 288 AshWindowTreeHost* AshWindowTreeHost::Create( | 288 AshWindowTreeHost* AshWindowTreeHost::Create( |
| 289 const AshWindowTreeHostInitParams& init_params) { | 289 const AshWindowTreeHostInitParams& init_params) { |
| 290 return new AshWindowTreeHostX11(init_params.initial_bounds); | 290 return new AshWindowTreeHostX11(init_params.initial_bounds); |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace ash | 293 } // namespace ash |
| OLD | NEW |