| 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> |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "ash/host/ash_window_tree_host_init_params.h" | 15 #include "ash/host/ash_window_tree_host_init_params.h" |
| 16 #include "ash/host/root_window_transformer.h" | 16 #include "ash/host/root_window_transformer.h" |
| 17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
| 18 #include "base/sys_info.h" | 18 #include "base/sys_info.h" |
| 19 #include "ui/aura/client/screen_position_client.h" | 19 #include "ui/aura/client/screen_position_client.h" |
| 20 #include "ui/aura/env.h" | 20 #include "ui/aura/env.h" |
| 21 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
| 22 #include "ui/aura/window_event_dispatcher.h" | 22 #include "ui/aura/window_event_dispatcher.h" |
| 23 #include "ui/base/x/x11_util.h" | 23 #include "ui/base/x/x11_util.h" |
| 24 #include "ui/events/device_data_manager.h" | 24 #include "ui/events/devices/device_data_manager.h" |
| 25 #include "ui/events/devices/x11/device_list_cache_x11.h" |
| 26 #include "ui/events/devices/x11/touch_factory_x11.h" |
| 25 #include "ui/events/event.h" | 27 #include "ui/events/event.h" |
| 26 #include "ui/events/event_utils.h" | 28 #include "ui/events/event_utils.h" |
| 27 #include "ui/events/platform/platform_event_source.h" | 29 #include "ui/events/platform/platform_event_source.h" |
| 28 #include "ui/events/x/device_list_cache_x.h" | |
| 29 #include "ui/events/x/touch_factory_x11.h" | |
| 30 #include "ui/gfx/rect.h" | 30 #include "ui/gfx/rect.h" |
| 31 #include "ui/gfx/screen.h" | 31 #include "ui/gfx/screen.h" |
| 32 | 32 |
| 33 namespace ash { | 33 namespace ash { |
| 34 | 34 |
| 35 AshWindowTreeHostX11::AshWindowTreeHostX11(const gfx::Rect& initial_bounds) | 35 AshWindowTreeHostX11::AshWindowTreeHostX11(const gfx::Rect& initial_bounds) |
| 36 : WindowTreeHostX11(initial_bounds), | 36 : WindowTreeHostX11(initial_bounds), |
| 37 transformer_helper_(this), | 37 transformer_helper_(this), |
| 38 display_ids_(std::make_pair(gfx::Display::kInvalidDisplayID, | 38 display_ids_(std::make_pair(gfx::Display::kInvalidDisplayID, |
| 39 gfx::Display::kInvalidDisplayID)) { | 39 gfx::Display::kInvalidDisplayID)) { |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 } | 251 } |
| 252 | 252 |
| 253 #if defined(OS_CHROMEOS) | 253 #if defined(OS_CHROMEOS) |
| 254 void AshWindowTreeHostX11::SetCrOSTapPaused(bool state) { | 254 void AshWindowTreeHostX11::SetCrOSTapPaused(bool state) { |
| 255 if (!ui::IsXInput2Available()) | 255 if (!ui::IsXInput2Available()) |
| 256 return; | 256 return; |
| 257 // Temporarily pause tap-to-click when the cursor is hidden. | 257 // Temporarily pause tap-to-click when the cursor is hidden. |
| 258 Atom prop = atom_cache()->GetAtom("Tap Paused"); | 258 Atom prop = atom_cache()->GetAtom("Tap Paused"); |
| 259 unsigned char value = state; | 259 unsigned char value = state; |
| 260 XIDeviceList dev_list = | 260 XIDeviceList dev_list = |
| 261 ui::DeviceListCacheX::GetInstance()->GetXI2DeviceList(xdisplay()); | 261 ui::DeviceListCacheX11::GetInstance()->GetXI2DeviceList(xdisplay()); |
| 262 | 262 |
| 263 // Only slave pointer devices could possibly have tap-paused property. | 263 // Only slave pointer devices could possibly have tap-paused property. |
| 264 for (int i = 0; i < dev_list.count; i++) { | 264 for (int i = 0; i < dev_list.count; i++) { |
| 265 if (dev_list[i].use == XISlavePointer) { | 265 if (dev_list[i].use == XISlavePointer) { |
| 266 Atom old_type; | 266 Atom old_type; |
| 267 int old_format; | 267 int old_format; |
| 268 unsigned long old_nvalues, bytes; | 268 unsigned long old_nvalues, bytes; |
| 269 unsigned char* data; | 269 unsigned char* data; |
| 270 int result = XIGetProperty(xdisplay(), | 270 int result = XIGetProperty(xdisplay(), |
| 271 dev_list[i].deviceid, | 271 dev_list[i].deviceid, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 #endif | 296 #endif |
| 297 | 297 |
| 298 AshWindowTreeHost* AshWindowTreeHost::Create( | 298 AshWindowTreeHost* AshWindowTreeHost::Create( |
| 299 const AshWindowTreeHostInitParams& init_params) { | 299 const AshWindowTreeHostInitParams& init_params) { |
| 300 return new AshWindowTreeHostX11(init_params.initial_bounds); | 300 return new AshWindowTreeHostX11(init_params.initial_bounds); |
| 301 } | 301 } |
| 302 | 302 |
| 303 } // namespace ash | 303 } // namespace ash |
| OLD | NEW |