Index: ui/aura/root_window_host_linux.cc |
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc |
index e3ececade9c853baffd90c200fcbd6bf3bbf3691..eb6ced5565b89cb3c6490284f54499fb064d5339 100644 |
--- a/ui/aura/root_window_host_linux.cc |
+++ b/ui/aura/root_window_host_linux.cc |
@@ -61,14 +61,6 @@ namespace { |
const int kBackMouseButton = 8; |
const int kForwardMouseButton = 9; |
-// These are the same values that are used to calibrate touch events in |
-// |CalibrateTouchCoordinates| (in ui/base/x/events_x.cc). |
-// TODO(sad|skuhne): Remove the duplication of values (http://crbug.com/147605) |
-const int kXRootWindowPaddingLeft = 40; |
-const int kXRootWindowPaddingRight = 40; |
-const int kXRootWindowPaddingBottom = 30; |
-const int kXRootWindowPaddingTop = 0; |
- |
const char* kAtomsToCache[] = { |
"WM_DELETE_WINDOW", |
"_NET_WM_PING", |
@@ -255,7 +247,8 @@ class RootWindowHostLinux::MouseMoveFilter { |
//////////////////////////////////////////////////////////////////////////////// |
// RootWindowHostLinux |
-RootWindowHostLinux::RootWindowHostLinux(const gfx::Rect& bounds) |
+RootWindowHostLinux::RootWindowHostLinux(const gfx::Rect& bounds, |
+ bool is_internal_display) |
: delegate_(NULL), |
xdisplay_(base::MessagePumpAuraX11::GetDefaultXDisplay()), |
xwindow_(0), |
@@ -267,7 +260,8 @@ RootWindowHostLinux::RootWindowHostLinux(const gfx::Rect& bounds) |
pointer_barriers_(NULL), |
touch_calibrate_(new internal::TouchEventCalibrate), |
mouse_move_filter_(new MouseMoveFilter), |
- atom_cache_(xdisplay_, kAtomsToCache) { |
+ atom_cache_(xdisplay_, kAtomsToCache), |
+ is_internal_display_(is_internal_display) { |
XSetWindowAttributes swa; |
memset(&swa, 0, sizeof(swa)); |
swa.background_pixmap = None; |
@@ -874,14 +868,7 @@ void RootWindowHostLinux::DispatchXI2Event(const base::NativeEvent& event) { |
#if defined(OS_CHROMEOS) |
if (base::chromeos::IsRunningOnChromeOS()) { |
if (!bounds_.Contains(touchev.location())) { |
- // This might still be in the bezel region. |
- gfx::Rect expanded(bounds_); |
- expanded.Inset(-kXRootWindowPaddingLeft, |
- -kXRootWindowPaddingTop, |
- -kXRootWindowPaddingRight, |
- -kXRootWindowPaddingBottom); |
- if (!expanded.Contains(touchev.location())) |
- break; |
+ break; |
} |
// X maps the touch-surface to the size of the X root-window. |
// In multi-monitor setup, Coordinate Transformation Matrix |
@@ -890,6 +877,10 @@ void RootWindowHostLinux::DispatchXI2Event(const base::NativeEvent& event) { |
// However, if aura root-window has non-zero origin, |
// we need to relocate the event into aura root-window coordinates. |
touchev.Relocate(bounds_.origin()); |
+#if defined(USE_XI2_MT) |
+ if (is_internal_display_) |
+ touchev.Calibrate(bounds_); |
+#endif |
} |
#endif // defined(OS_CHROMEOS) |
delegate_->OnHostTouchEvent(&touchev); |
@@ -1003,8 +994,9 @@ scoped_ptr<ui::XScopedImage> RootWindowHostLinux::GetXImage( |
} |
// static |
-RootWindowHost* RootWindowHost::Create(const gfx::Rect& bounds) { |
- return new RootWindowHostLinux(bounds); |
+RootWindowHost* RootWindowHost::Create(const gfx::Rect& bounds, |
+ bool is_internal_display) { |
+ return new RootWindowHostLinux(bounds, is_internal_display); |
} |
// static |