diff options
author | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-20 18:50:13 +0000 |
---|---|---|
committer | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-20 18:50:13 +0000 |
commit | af47ffe71e74dbaf1f1feea1b69ba1b4e6698098 (patch) | |
tree | d7b7bfa4c5c0b02a44fc89a2fc3a2f423c9d235b | |
parent | 9376b75a8cc121f025fb584fccf5a64dbacc2b9e (diff) | |
download | chromium_src-af47ffe71e74dbaf1f1feea1b69ba1b4e6698098.zip chromium_src-af47ffe71e74dbaf1f1feea1b69ba1b4e6698098.tar.gz chromium_src-af47ffe71e74dbaf1f1feea1b69ba1b4e6698098.tar.bz2 |
Make ui::GetWindowRect() take the window decorations in account
BUG=344749
TEST=Manual, see bug
Review URL: https://codereview.chromium.org/173233002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252336 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ui/base/x/x11_util.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc index 2508ce8..b914ef0 100644 --- a/ui/base/x/x11_util.cc +++ b/ui/base/x/x11_util.cc @@ -632,6 +632,15 @@ bool GetWindowRect(XID window, gfx::Rect* rect) { return false; *rect = gfx::Rect(x, y, width, height); + + std::vector<int> insets; + if (GetIntArrayProperty(window, "_NET_FRAME_EXTENTS", &insets) && + insets.size() == 4) { + rect->Inset(-insets[0], -insets[2], -insets[1], -insets[3]); + } + // Not all window managers support _NET_FRAME_EXTENTS so return true even if + // requesting the property fails. + return true; } |