Chromium Code Reviews| Index: ui/events/test/events_test_utils_x11.cc |
| diff --git a/ui/events/test/events_test_utils_x11.cc b/ui/events/test/events_test_utils_x11.cc |
| index 76b4bce7511b33b20008e38c95d041a64c1d28f6..9c724b4b93c538d5951f509d366f87f8f9690825 100644 |
| --- a/ui/events/test/events_test_utils_x11.cc |
| +++ b/ui/events/test/events_test_utils_x11.cc |
| @@ -95,7 +95,8 @@ void InitValuatorsForXIDeviceEvent(XIDeviceEvent* xiev) { |
| XEvent* CreateXInput2Event(int deviceid, |
| int evtype, |
| int tracking_id, |
| - const gfx::Point& location) { |
| + const gfx::Point& location, |
| + ::Window target) { |
| XEvent* event = new XEvent; |
| memset(event, 0, sizeof(*event)); |
| event->type = GenericEvent; |
| @@ -109,6 +110,7 @@ XEvent* CreateXInput2Event(int deviceid, |
| xiev->detail = tracking_id; |
| xiev->event_x = location.x(); |
| xiev->event_y = location.y(); |
| + xiev->event = target; |
|
sadrul
2014/05/07 20:00:27
Can we always set this to DefaultRootWindow() with
Yufeng Shen (Slow to review)
2014/05/07 22:02:58
Done.
|
| if (evtype == XI_ButtonPress || evtype == XI_ButtonRelease) { |
| xiev->buttons.mask_len = 8; |
| xiev->buttons.mask = new unsigned char[xiev->buttons.mask_len]; |
| @@ -169,7 +171,8 @@ void ScopedXI2Event::InitGenericButtonEvent(int deviceid, |
| const gfx::Point& location, |
| int flags) { |
| event_.reset(CreateXInput2Event(deviceid, |
| - XIButtonEventType(type), 0, gfx::Point())); |
| + XIButtonEventType(type), 0, gfx::Point(), |
| + ::Window())); |
| XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(event_->xcookie.data); |
| xievent->mods.effective = XEventState(flags); |
| xievent->detail = XButtonEventButton(type, flags); |
| @@ -194,7 +197,8 @@ void ScopedXI2Event::InitScrollEvent(int deviceid, |
| int x_offset_ordinal, |
| int y_offset_ordinal, |
| int finger_count) { |
| - event_.reset(CreateXInput2Event(deviceid, XI_Motion, 0, gfx::Point())); |
| + event_.reset(CreateXInput2Event(deviceid, XI_Motion, 0, gfx::Point(), |
| + ::Window())); |
| Valuator valuators[] = { |
| Valuator(DeviceDataManager::DT_CMT_SCROLL_X, x_offset), |
| @@ -213,7 +217,8 @@ void ScopedXI2Event::InitFlingScrollEvent(int deviceid, |
| int x_velocity_ordinal, |
| int y_velocity_ordinal, |
| bool is_cancel) { |
| - event_.reset(CreateXInput2Event(deviceid, XI_Motion, deviceid, gfx::Point())); |
| + event_.reset(CreateXInput2Event(deviceid, XI_Motion, deviceid, gfx::Point(), |
| + ::Window())); |
| Valuator valuators[] = { |
| Valuator(DeviceDataManager::DT_CMT_FLING_STATE, is_cancel ? 1 : 0), |
| @@ -231,8 +236,10 @@ void ScopedXI2Event::InitTouchEvent(int deviceid, |
| int evtype, |
| int tracking_id, |
| const gfx::Point& location, |
| - const std::vector<Valuator>& valuators) { |
| - event_.reset(CreateXInput2Event(deviceid, evtype, tracking_id, location)); |
| + const std::vector<Valuator>& valuators, |
| + ::Window target) { |
| + event_.reset(CreateXInput2Event(deviceid, evtype, tracking_id, location, |
| + target)); |
| SetUpValuators(valuators); |
| } |