| 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 "ui/events/platform/x11/x11_hotplug_event_handler.h" | 5 #include "ui/events/platform/x11/x11_hotplug_event_handler.h" |
| 6 | 6 |
| 7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
| 8 #include <X11/extensions/XInput.h> | 8 #include <X11/extensions/XInput.h> |
| 9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
| 10 | 10 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 const DisplayState& display_state, | 238 const DisplayState& display_state, |
| 239 scoped_refptr<base::TaskRunner> reply_runner, | 239 scoped_refptr<base::TaskRunner> reply_runner, |
| 240 const TouchscreenDeviceCallback& callback) { | 240 const TouchscreenDeviceCallback& callback) { |
| 241 std::vector<TouchscreenDevice> devices; | 241 std::vector<TouchscreenDevice> devices; |
| 242 if (display_state.mt_position_x == None || | 242 if (display_state.mt_position_x == None || |
| 243 display_state.mt_position_y == None) | 243 display_state.mt_position_y == None) |
| 244 return; | 244 return; |
| 245 | 245 |
| 246 std::set<int> no_match_touchscreen; | 246 std::set<int> no_match_touchscreen; |
| 247 for (const DeviceInfo& device_info : device_infos) { | 247 for (const DeviceInfo& device_info : device_infos) { |
| 248 if (!device_info.enabled || device_info.use != XIFloatingSlave) | 248 if (!device_info.enabled || (device_info.use != XIFloatingSlave |
| 249 continue; // Assume all touchscreens are floating slaves | 249 && device_info.use != XISlavePointer)) |
| 250 continue; |
| 250 | 251 |
| 251 double max_x = -1.0; | 252 double max_x = -1.0; |
| 252 double max_y = -1.0; | 253 double max_y = -1.0; |
| 253 bool is_direct_touch = false; | 254 bool is_direct_touch = false; |
| 254 | 255 |
| 255 for (const ValuatorClassInfo& valuator : device_info.valuator_class_infos) { | 256 for (const ValuatorClassInfo& valuator : device_info.valuator_class_infos) { |
| 256 if (display_state.mt_position_x == valuator.label) { | 257 if (display_state.mt_position_x == valuator.label) { |
| 257 // Ignore X axis valuator with unexpected properties | 258 // Ignore X axis valuator with unexpected properties |
| 258 if (valuator.number == 0 && valuator.mode == Absolute && | 259 if (valuator.number == 0 && valuator.mode == Absolute && |
| 259 valuator.min == 0.0) { | 260 valuator.min == 0.0) { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 base::WorkerPool::PostTask(FROM_HERE, | 348 base::WorkerPool::PostTask(FROM_HERE, |
| 348 base::Bind(&HandleHotplugEventInWorker, | 349 base::Bind(&HandleHotplugEventInWorker, |
| 349 device_infos, | 350 device_infos, |
| 350 display_state, | 351 display_state, |
| 351 base::ThreadTaskRunnerHandle::Get(), | 352 base::ThreadTaskRunnerHandle::Get(), |
| 352 callbacks), | 353 callbacks), |
| 353 true /* task_is_slow */); | 354 true /* task_is_slow */); |
| 354 } | 355 } |
| 355 | 356 |
| 356 } // namespace ui | 357 } // namespace ui |
| OLD | NEW |