summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 20:10:04 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 20:10:04 +0000
commit2532d183b1cdf60e166f6c376c5912c113b307db (patch)
treec55b95f51a797048418328c42c73aec995fb60e1 /views
parentd3155c916fd4a289d9e5995056d83725f0ccc101 (diff)
downloadchromium_src-2532d183b1cdf60e166f6c376c5912c113b307db.zip
chromium_src-2532d183b1cdf60e166f6c376c5912c113b307db.tar.gz
chromium_src-2532d183b1cdf60e166f6c376c5912c113b307db.tar.bz2
Fixes possible crash in tool tip manager.
BUG=none TEST=none Review URL: http://codereview.chromium.org/242051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27527 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/widget/tooltip_manager_gtk.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/views/widget/tooltip_manager_gtk.cc b/views/widget/tooltip_manager_gtk.cc
index f3bcb61..9a4316b 100644
--- a/views/widget/tooltip_manager_gtk.cc
+++ b/views/widget/tooltip_manager_gtk.cc
@@ -103,8 +103,15 @@ static void AdjustLabel(GtkTooltip* tooltip) {
GtkLabel* real_label = NULL;
gtk_container_foreach(GTK_CONTAINER(parent), LabelLocatorCallback,
static_cast<gpointer>(&real_label));
- if (real_label)
+ if (real_label) {
+ // For some reason I'm occasionally seeing a crash in trying to get font
+ // metrics. Explicitly setting the font avoids this.
+ PangoFontDescription* pfd =
+ gfx::Font::PangoFontFromGfxFont(gfx::Font());
+ gtk_widget_modify_font(GTK_WIDGET(real_label), pfd);
+ pango_font_description_free(pfd);
gtk_label_set_max_width_chars(GTK_LABEL(real_label), 3000);
+ }
}
}