diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-22 00:58:07 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-22 00:58:07 +0000 |
commit | 78d9630c596d026c1fd13ece83c4f3f2128dfaf4 (patch) | |
tree | 1d3ace3f63cd7a745210aef4ea1bd20f4489c03f /ui/aura/root_window_host_linux.cc | |
parent | 3e7b9c333836705ce98f2109ac68920f7e1c9449 (diff) | |
download | chromium_src-78d9630c596d026c1fd13ece83c4f3f2128dfaf4.zip chromium_src-78d9630c596d026c1fd13ece83c4f3f2128dfaf4.tar.gz chromium_src-78d9630c596d026c1fd13ece83c4f3f2128dfaf4.tar.bz2 |
Emulate mouse move across extended desktops
BUG=123160
TEST=manual
Review URL: https://chromiumcodereview.appspot.com/10581008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143499 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/root_window_host_linux.cc')
-rw-r--r-- | ui/aura/root_window_host_linux.cc | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc index fe64054..1f0babe 100644 --- a/ui/aura/root_window_host_linux.cc +++ b/ui/aura/root_window_host_linux.cc @@ -889,32 +889,33 @@ bool RootWindowHostLinux::ConfineCursorToRootWindow() { DCHECK(!pointer_barriers_.get()); if (pointer_barriers_.get()) return false; - // Pointer barriers extend all the way across the screen to - // avoid leaks at the corners. - gfx::Size screen_size = RootWindowHost::GetNativeScreenSize(); + // TODO(oshima): There is a know issue where the pointer barrier + // leaks mouse pointer under certain conditions. crbug.com/133694. pointer_barriers_.reset(new XID[4]); - // Horizontal barriers. + // Horizontal, top barriers. pointer_barriers_[0] = XFixesCreatePointerBarrier( xdisplay_, x_root_window_, - 0, bounds_.y(), screen_size.width(), bounds_.y(), + bounds_.x(), bounds_.y(), bounds_.right(), bounds_.y(), BarrierPositiveY, - 0, NULL); // default device + 0, XIAllDevices); + // Horizontal, bottom barriers. pointer_barriers_[1] = XFixesCreatePointerBarrier( xdisplay_, x_root_window_, - 0, bounds_.bottom(), screen_size.width(), bounds_.bottom(), + bounds_.x(), bounds_.bottom(), bounds_.right(), bounds_.bottom(), BarrierNegativeY, - 0, NULL); // default device - // Vertical barriers. + 0, XIAllDevices); + // Vertical, left barriers. pointer_barriers_[2] = XFixesCreatePointerBarrier( xdisplay_, x_root_window_, - bounds_.x(), 0, bounds_.x(), screen_size.height(), + bounds_.x(), bounds_.y(), bounds_.x(), bounds_.bottom(), BarrierPositiveX, - 0, NULL); // default device + 0, XIAllDevices); + // Vertical, right barriers. pointer_barriers_[3] = XFixesCreatePointerBarrier( xdisplay_, x_root_window_, - bounds_.right(), 0, bounds_.right(), screen_size.height(), + bounds_.right(), bounds_.y(), bounds_.right(), bounds_.bottom(), BarrierNegativeX, - 0, NULL); // default device + 0, XIAllDevices); #endif return true; } @@ -932,8 +933,9 @@ void RootWindowHostLinux::UnConfineCursor() { } void RootWindowHostLinux::MoveCursorTo(const gfx::Point& location) { - XWarpPointer(xdisplay_, None, xwindow_, 0, 0, 0, 0, location.x(), - location.y()); + XWarpPointer(xdisplay_, None, x_root_window_, 0, 0, 0, 0, + bounds_.x() + location.x(), + bounds_.y() + location.y()); } void RootWindowHostLinux::SetFocusWhenShown(bool focus_when_shown) { |