Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5491)

Unified Diff: chrome/common/gtk_util.cc

Issue 174201: More interactive test porting for Linux. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fixes Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_focus_uitest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/gtk_util.cc
===================================================================
--- chrome/common/gtk_util.cc (revision 23879)
+++ chrome/common/gtk_util.cc (working copy)
@@ -148,35 +148,14 @@
}
gfx::Point GetWidgetScreenPosition(GtkWidget* widget) {
- int x = 0, y = 0;
+ gint x, y;
+ gdk_window_get_origin(widget->window, &x, &y);
tony 2009/08/21 21:13:39 x & y still get filled in if there's no window? I
Evan Stade 2009/08/21 21:43:42 uh, there should always be a window, right? If the
tony 2009/08/21 21:48:51 If there's always a gdk window, can we add a DCHEC
- if (GTK_IS_WINDOW(widget)) {
- gdk_window_get_origin(widget->window, &x, &y);
- return gfx::Point(x, y);
- } else {
- x = widget->allocation.x;
- y = widget->allocation.y;
+ if (!GTK_IS_WINDOW(widget)) {
+ x += widget->allocation.x;
+ y += widget->allocation.y;
}
- GtkWidget* parent = gtk_widget_get_parent(widget);
- while (parent) {
- if (GTK_IS_WINDOW(parent)) {
- int window_x, window_y;
- // Returns the origin of the window, excluding the frame if one is exists.
- gdk_window_get_origin(parent->window, &window_x, &window_y);
- x += window_x;
- y += window_y;
- return gfx::Point(x, y);
- }
-
- if (!GTK_WIDGET_NO_WINDOW(parent)) {
- x += parent->allocation.x;
- y += parent->allocation.y;
- }
-
- parent = gtk_widget_get_parent(parent);
- }
-
return gfx::Point(x, y);
}
« no previous file with comments | « chrome/browser/browser_focus_uitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698