diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-09 01:06:00 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-09 01:06:00 +0000 |
commit | 685d692a8bb6618fd54cfb7fb3c3782582deec4a (patch) | |
tree | b42a8758f0cb40817161fc170be06d2a62147995 | |
parent | b05d45dbbee2b9347e0f7b8dcda291e3efdcbd4a (diff) | |
download | chromium_src-685d692a8bb6618fd54cfb7fb3c3782582deec4a.zip chromium_src-685d692a8bb6618fd54cfb7fb3c3782582deec4a.tar.gz chromium_src-685d692a8bb6618fd54cfb7fb3c3782582deec4a.tar.bz2 |
Speculative fix for window dragging in X11 multi monitor setups
The returned rectangles for ShapeInput rects from XShapeGetRectangles() may be
in window space instead of screen space, so translate by the window's offset to
the screen before comparing to screen_loc.
BUG=153565
Review URL: https://chromiumcodereview.appspot.com/11087013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160757 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ui/base/x/x11_util.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc index 4cc5dc3..d6e53f1 100644 --- a/ui/base/x/x11_util.cc +++ b/ui/base/x/x11_util.cc @@ -641,8 +641,11 @@ bool WindowContainsPoint(XID window, gfx::Point screen_loc) { return true; bool is_in_input_rects = false; for (int i = 0; i < input_rects_size; ++i) { + // The ShapeInput rects appear to be in window space, so we have to + // translate by the window_rect's offset to map to screen space. gfx::Rect input_rect = - gfx::Rect(input_rects[i].x, input_rects[i].y, + gfx::Rect(input_rects[i].x + window_rect.x(), + input_rects[i].y + window_rect.y(), input_rects[i].width, input_rects[i].height); if (input_rect.Contains(screen_loc)) { is_in_input_rects = true; |