summaryrefslogtreecommitdiffstats
path: root/chrome/common/x11_util.cc
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 22:31:45 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 22:31:45 +0000
commitfda8974e0a1daa704be0dc33fe04ae4564310c12 (patch)
tree73e04108913d6c346aa8c866a73a94a60e1b84d3 /chrome/common/x11_util.cc
parent804a44b4f3d42d486850e35ac1070acee5abf754 (diff)
downloadchromium_src-fda8974e0a1daa704be0dc33fe04ae4564310c12.zip
chromium_src-fda8974e0a1daa704be0dc33fe04ae4564310c12.tar.gz
chromium_src-fda8974e0a1daa704be0dc33fe04ae4564310c12.tar.bz2
Use the convenience function gdk_screen_get_window_stack to enumerate top-level gdk windows instead of querying Xlib directly, which doesn't work across many window managers.
BUG=none TEST=Exhaustive tab dragging in multiple window managers (Compiz, Metacity, KWM). Review URL: http://codereview.chromium.org/119345 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18098 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/x11_util.cc')
-rw-r--r--chrome/common/x11_util.cc24
1 files changed, 5 insertions, 19 deletions
diff --git a/chrome/common/x11_util.cc b/chrome/common/x11_util.cc
index b1a24bf..522921f 100644
--- a/chrome/common/x11_util.cc
+++ b/chrome/common/x11_util.cc
@@ -144,34 +144,20 @@ bool IsWindowVisible(XID window) {
}
bool GetWindowRect(XID window, gfx::Rect* rect) {
- Window root_window;
+ Window root, child;
int x, y;
unsigned int width, height;
unsigned int border_width, depth;
- if (!XGetGeometry(GetXDisplay(), window, &root_window, &x, &y,
+ if (!XGetGeometry(GetXDisplay(), window, &root, &x, &y,
&width, &height, &border_width, &depth))
return false;
- *rect = gfx::Rect(x, y, width, height);
- return true;
-}
-
-bool EnumerateChildWindows(XID root, EnumerateWindowsDelegate* delegate) {
- XID parent;
- XID* children;
- unsigned int num_children;
- int status = XQueryTree(GetXDisplay(), root, &root, &parent,
- &children, &num_children);
- if (status == 0)
+ if (!XTranslateCoordinates(GetSecondaryDisplay(), window, root,
+ 0, 0, &x, &y, &child))
return false;
- for (unsigned int i = 0; i < num_children; i++) {
- if (delegate->ShouldStopIterating(children[i]))
- break;
- }
-
- XFree(children);
+ *rect = gfx::Rect(x, y, width, height);
return true;
}