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

Unified Diff: ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc

Issue 89413002: linux aura: Support touch events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_root_window_host_x11.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6efc822b366dc54f254159dae7c40df47ff0d5d9..b9087c324ecc234c67fb36f7a0460574da31ab16 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
@@ -1112,6 +1112,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_TOUCH_PRESSED) {
+ 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;
@@ -1277,17 +1288,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:
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_root_window_host_x11.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698