diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 22:54:08 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 22:54:08 +0000 |
commit | 245318d3814e9da0e5f997645f2660dbae21e491 (patch) | |
tree | 66c5b32b6a06a1b041e5df0b5c696174d8ae6823 /chrome/common | |
parent | 0d5a3581fa8e7913470fa2f3342b9b7d58636872 (diff) | |
download | chromium_src-245318d3814e9da0e5f997645f2660dbae21e491.zip chromium_src-245318d3814e9da0e5f997645f2660dbae21e491.tar.gz chromium_src-245318d3814e9da0e5f997645f2660dbae21e491.tar.bz2 |
gtk: Fix infobubble placement in non-debug builds.
I'd put an important function call inside of a DCHECK().
BUG=27099
TEST=checked that they're placed correctly in release builds now
Review URL: http://codereview.chromium.org/389014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31726 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/gtk_util.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/chrome/common/gtk_util.cc b/chrome/common/gtk_util.cc index fac62f4..69c24f2 100644 --- a/chrome/common/gtk_util.cc +++ b/chrome/common/gtk_util.cc @@ -569,11 +569,17 @@ void StackPopupWindow(GtkWidget* popup, GtkWidget* toplevel) { } gfx::Rect GetWidgetRectRelativeToToplevel(GtkWidget* widget) { + DCHECK(GTK_WIDGET_REALIZED(widget)); + + GtkWidget* toplevel = gtk_widget_get_toplevel(widget); + DCHECK(toplevel); + DCHECK(GTK_WIDGET_REALIZED(toplevel)); + gint x = 0, y = 0; - DCHECK(gtk_widget_translate_coordinates(widget, - gtk_widget_get_toplevel(widget), - 0, 0, - &x, &y)); + gtk_widget_translate_coordinates(widget, + toplevel, + 0, 0, + &x, &y); return gfx::Rect(x, y, widget->allocation.width, widget->allocation.height); } |