From d1f355bba03332716cf667efaa5e374402404642 Mon Sep 17 00:00:00 2001 From: "oshima@chromium.org" Date: Tue, 8 May 2012 00:12:28 +0000 Subject: Confine cursor after bounds is updated. BUG=126342 TEST=tested manually on the device Review URL: https://chromiumcodereview.appspot.com/10383051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135762 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/aura/root_window_host_linux.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to '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 d0e9780..d9b9cd3 100644 --- a/ui/aura/root_window_host_linux.cc +++ b/ui/aura/root_window_host_linux.cc @@ -489,6 +489,13 @@ bool RootWindowHostLinux::Dispatch(const base::NativeEvent& event) { case ConfigureNotify: { DCHECK_EQ(xwindow_, xev->xconfigure.window); DCHECK_EQ(xwindow_, xev->xconfigure.event); + // It's possible that the X window may be resized by some other means than + // from within aura (e.g. the X window manager can change the size). Make + // sure the root window size is maintained properly. + gfx::Rect bounds(xev->xconfigure.x, xev->xconfigure.y, + xev->xconfigure.width, xev->xconfigure.height); + bool size_changed = bounds_.size() != bounds.size(); + bounds_ = bounds; // Update barrier and mouse location when the root window has // moved/resized. if (pointer_barriers_.get()) { @@ -497,13 +504,6 @@ bool RootWindowHostLinux::Dispatch(const base::NativeEvent& event) { XWarpPointer(xdisplay_, None, xwindow_, 0, 0, 0, 0, p.x(), p.y()); ConfineCursorToRootWindow(); } - // It's possible that the X window may be resized by some other means than - // from within aura (e.g. the X window manager can change the size). Make - // sure the root window size is maintained properly. - gfx::Rect bounds(xev->xconfigure.x, xev->xconfigure.y, - xev->xconfigure.width, xev->xconfigure.height); - bool size_changed = bounds_.size() != bounds.size(); - bounds_ = bounds; if (size_changed) root_window_->OnHostResized(bounds.size()); break; -- cgit v1.1