diff options
author | yusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-24 20:53:23 +0000 |
---|---|---|
committer | yusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-24 20:53:23 +0000 |
commit | 718b26cd02ffe63b82650e81cb9bb5b0634d62c7 (patch) | |
tree | a7b16b40dfe8f344b31b5c575c5acb61cb7f1af7 /ui/aura/root_window_host_linux.cc | |
parent | a6b4ee0441f5e7199c583f924056dca14b889208 (diff) | |
download | chromium_src-718b26cd02ffe63b82650e81cb9bb5b0634d62c7.zip chromium_src-718b26cd02ffe63b82650e81cb9bb5b0634d62c7.tar.gz chromium_src-718b26cd02ffe63b82650e81cb9bb5b0634d62c7.tar.bz2 |
Move last_mouse_location_ from aura::RootWindow to aura::Env to support multiple root windows.
BUG=136814
TEST=1) the new ash_unittests as well as existing tests passed. 2) ran ash_shell by './out/Release/ash_shell --ash-extended-desktop --aura-host-window-size=100+0-500x500,610+0-300x300 --ash-virtual-screen-coordinates', then move the cursor to the second (right hand side) window, then click the right button. confirmed that the popup menu is shown on the right window.
Review URL: https://chromiumcodereview.appspot.com/10781028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148193 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 | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc index 04f7587..f82f6e49 100644 --- a/ui/aura/root_window_host_linux.cc +++ b/ui/aura/root_window_host_linux.cc @@ -632,7 +632,7 @@ bool RootWindowHostLinux::Dispatch(const base::NativeEvent& event) { // moved/resized. if (pointer_barriers_.get()) { UnConfineCursor(); - gfx::Point p = root_window_->last_mouse_location(); + gfx::Point p = gfx::Screen::GetCursorScreenPoint(); XWarpPointer(xdisplay_, None, xwindow_, 0, 0, 0, 0, p.x(), p.y()); ConfineCursorToRootWindow(); } @@ -866,7 +866,7 @@ void RootWindowHostLinux::ShowCursor(bool show) { SetCursorInternal(show ? current_cursor_ : ui::kCursorNone); } -gfx::Point RootWindowHostLinux::QueryMouseLocation() { +bool RootWindowHostLinux::QueryMouseLocation(gfx::Point* location_return) { ::Window root_return, child_return; int root_x_return, root_y_return, win_x_return, win_y_return; unsigned int mask_return; @@ -877,8 +877,10 @@ gfx::Point RootWindowHostLinux::QueryMouseLocation() { &root_x_return, &root_y_return, &win_x_return, &win_y_return, &mask_return); - return gfx::Point(max(0, min(bounds_.width(), win_x_return)), - max(0, min(bounds_.height(), win_y_return))); + *location_return = gfx::Point(max(0, min(bounds_.width(), win_x_return)), + max(0, min(bounds_.height(), win_y_return))); + return (win_x_return >= 0 && win_x_return < bounds_.width() && + win_y_return >= 0 && win_y_return < bounds_.height()); } bool RootWindowHostLinux::ConfineCursorToRootWindow() { |