GetWindowRect() on X11 does not correctly translate the coordinate

XWindowAttributes.x and y are in the coordinate of the parent window, so
XTranslateCoordinates() should be used to do the translation.
Meanwhile this change reduces the scope of the XErrorTrap in GetWindowList()
function to ensure the callback can use other XErrorTrap to cover other X
function calls.

Bug: webrtc:7950
Change-Id: I520227b11704c5a0cb665d9de86925ed4e86540d
Reviewed-by: Jamie Walch <>
Commit-Queue: Zijie He <>
Cr-Original-Commit-Position: refs/heads/master@{#19591}
Cr-Mirrored-Commit: a787702417b1cef9d2ea2354b770f93c3e144528
2 files changed