Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: ui/events/devices/x11/device_data_manager_x11.h

Issue 749063003: Fix grabbing capture when the mouse is pressed on Desktop Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/events/devices/x11/device_data_manager_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_ 5 #ifndef UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_
6 #define UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_ 6 #define UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_
7 7
8 // Generically-named #defines from Xlib is conflicting with symbols in GTest. 8 // Generically-named #defines from Xlib is conflicting with symbols in GTest.
9 // So many tests .cc file #undef Bool before including device_data_manager.h, 9 // So many tests .cc file #undef Bool before including device_data_manager.h,
10 // which makes Bool unrecognized in XInput2.h. 10 // which makes Bool unrecognized in XInput2.h.
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 void SetDisabledKeyboardAllowedKeys( 232 void SetDisabledKeyboardAllowedKeys(
233 scoped_ptr<std::set<KeyboardCode> > excepted_keys); 233 scoped_ptr<std::set<KeyboardCode> > excepted_keys);
234 234
235 // Disables and enables events from devices by device id. 235 // Disables and enables events from devices by device id.
236 void DisableDevice(unsigned int deviceid); 236 void DisableDevice(unsigned int deviceid);
237 void EnableDevice(unsigned int deviceid); 237 void EnableDevice(unsigned int deviceid);
238 238
239 // Returns true if |native_event| should be blocked. 239 // Returns true if |native_event| should be blocked.
240 bool IsEventBlocked(const base::NativeEvent& native_event); 240 bool IsEventBlocked(const base::NativeEvent& native_event);
241 241
242 const std::vector<int>& master_pointers() const {
243 return master_pointers_;
244 }
245
242 protected: 246 protected:
243 // DeviceHotplugEventObserver: 247 // DeviceHotplugEventObserver:
244 void OnKeyboardDevicesUpdated( 248 void OnKeyboardDevicesUpdated(
245 const std::vector<KeyboardDevice>& devices) override; 249 const std::vector<KeyboardDevice>& devices) override;
246 250
247 private: 251 private:
248 DeviceDataManagerX11(); 252 DeviceDataManagerX11();
249 ~DeviceDataManagerX11() override; 253 ~DeviceDataManagerX11() override;
250 254
251 // Initialize the XInput related system information. 255 // Initialize the XInput related system information.
(...skipping 15 matching lines...) Expand all
267 int xi_opcode_; 271 int xi_opcode_;
268 272
269 // A quick lookup table for determining if the XI event is an XIDeviceEvent. 273 // A quick lookup table for determining if the XI event is an XIDeviceEvent.
270 std::bitset<kMaxXIEventType> xi_device_event_types_; 274 std::bitset<kMaxXIEventType> xi_device_event_types_;
271 275
272 // A quick lookup table for determining if events from the pointer device 276 // A quick lookup table for determining if events from the pointer device
273 // should be processed. 277 // should be processed.
274 std::bitset<kMaxDeviceNum> cmt_devices_; 278 std::bitset<kMaxDeviceNum> cmt_devices_;
275 std::bitset<kMaxDeviceNum> touchpads_; 279 std::bitset<kMaxDeviceNum> touchpads_;
276 280
281 // List of the master pointer devices.
282 std::vector<int> master_pointers_;
283
277 // A quick lookup table for determining if events from the XI device 284 // A quick lookup table for determining if events from the XI device
278 // should be blocked. 285 // should be blocked.
279 std::bitset<kMaxDeviceNum> blocked_devices_; 286 std::bitset<kMaxDeviceNum> blocked_devices_;
280 287
281 // The set of keys allowed while the keyboard is blocked. 288 // The set of keys allowed while the keyboard is blocked.
282 scoped_ptr<std::set<KeyboardCode> > blocked_keyboard_allowed_keys_; 289 scoped_ptr<std::set<KeyboardCode> > blocked_keyboard_allowed_keys_;
283 290
284 // Number of valuators on the specific device. 291 // Number of valuators on the specific device.
285 int valuator_count_[kMaxDeviceNum]; 292 int valuator_count_[kMaxDeviceNum];
286 293
(...skipping 28 matching lines...) Expand all
315 322
316 unsigned char button_map_[256]; 323 unsigned char button_map_[256];
317 int button_map_count_; 324 int button_map_count_;
318 325
319 DISALLOW_COPY_AND_ASSIGN(DeviceDataManagerX11); 326 DISALLOW_COPY_AND_ASSIGN(DeviceDataManagerX11);
320 }; 327 };
321 328
322 } // namespace ui 329 } // namespace ui
323 330
324 #endif // UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_ 331 #endif // UI_EVENTS_DEVICES_X11_DEVICE_DATA_MANAGER_X11_H_
OLDNEW
« no previous file with comments | « no previous file | ui/events/devices/x11/device_data_manager_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698