Chromium Code Reviews| Index: ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc |
| diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc |
| index 37c9fa76d7a05c54380e9aaf3db06e5ac95abb54..eac7132635e4ab1029e133022ac06e583820f831 100644 |
| --- a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc |
| +++ b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc |
| @@ -1113,6 +1113,17 @@ void DesktopRootWindowHostX11::DispatchMouseEvent(ui::MouseEvent* event) { |
| } |
| } |
| +void DesktopRootWindowHostX11::DispatchTouchEvent(ui::TouchEvent* event) { |
| + if (g_current_capture && g_current_capture != this && |
| + event->type() == ui::ET_MOUSE_PRESSED) { |
|
dshwang
2013/12/04 17:37:27
s/ET_MOUSE_PRESSED/ET_TOUCH_PRESSED/ ?
why Dispat
sadrul
2013/12/04 17:57:29
Whoops. Fixed.
|
| + event->ConvertLocationToTarget(root_window_->window(), |
| + g_current_capture->root_window_->window()); |
| + g_current_capture->delegate_->OnHostTouchEvent(event); |
| + } else { |
| + delegate_->OnHostTouchEvent(event); |
| + } |
| +} |
| + |
| void DesktopRootWindowHostX11::ResetWindowRegion() { |
| if (!IsMaximized()) { |
| gfx::Path window_mask; |
| @@ -1278,17 +1289,17 @@ bool DesktopRootWindowHostX11::Dispatch(const base::NativeEvent& event) { |
| int num_coalesced = 0; |
| switch (type) { |
| - // case ui::ET_TOUCH_MOVED: |
| - // num_coalesced = CoalescePendingMotionEvents(xev, &last_event); |
| - // if (num_coalesced > 0) |
| - // xev = &last_event; |
| - // // fallthrough |
| - // case ui::ET_TOUCH_PRESSED: |
| - // case ui::ET_TOUCH_RELEASED: { |
| - // ui::TouchEvent touchev(xev); |
| - // delegate_->OnHostTouchEvent(&touchev); |
| - // break; |
| - // } |
| + case ui::ET_TOUCH_MOVED: |
| + num_coalesced = ui::CoalescePendingMotionEvents(xev, &last_event); |
| + if (num_coalesced > 0) |
| + xev = &last_event; |
| + // fallthrough |
| + case ui::ET_TOUCH_PRESSED: |
| + case ui::ET_TOUCH_RELEASED: { |
| + ui::TouchEvent touchev(xev); |
| + DispatchTouchEvent(&touchev); |
| + break; |
| + } |
| case ui::ET_MOUSE_MOVED: |
| case ui::ET_MOUSE_DRAGGED: |
| case ui::ET_MOUSE_PRESSED: |