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

Unified Diff: views/widget/widget_gtk.cc

Issue 525105: Fixes bug in WidgetGtk. WidgetGtk::GetBounds can end up crashing. I... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/widget_gtk.cc
===================================================================
--- views/widget/widget_gtk.cc (revision 35755)
+++ views/widget/widget_gtk.cc (working copy)
@@ -66,7 +66,12 @@
while (root && !GTK_IS_WINDOW(root)) {
root = gtk_widget_get_parent(root);
}
- DCHECK(root);
+ if (!root) {
+ // If root is null we're not parented. Return 0x0 and assume the caller will
+ // query again when we're parented.
+ *x = *y = 0;
+ return;
+ }
// Translate the coordinate from widget to root window.
gtk_widget_translate_coordinates(widget, root, 0, 0, x, y);
// Then adjust the position with the position of the root window.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698