diff -r b0659f31989d -r 77664079d0f0 pidgin/gtkimhtml.c --- a/pidgin/gtkimhtml.c Mon Jan 20 07:39:26 2014 +0530 +++ b/pidgin/gtkimhtml.c Mon Jan 20 00:02:17 2014 -0800 @@ -558,7 +558,13 @@ g_return_val_if_fail(GTK_IS_IMHTML(imhtml), FALSE); - layout = gtk_widget_create_pango_layout(imhtml->tip_window, imhtml->tip); + /* We set the text in a separate function call so we can specify a + max length. This is important so the tooltip isn't too wide for + the screen, and also because some X library function exits the + process when it can't allocate enough memory for a super wide + tooltip. */ + layout = gtk_widget_create_pango_layout(imhtml->tip_window, NULL); + pango_layout_set_text(layout, imhtml->tip, 200); style = gtk_widget_get_style(imhtml->tip_window); #if GTK_CHECK_VERSION(3,0,0) @@ -627,7 +633,15 @@ #endif gtk_widget_ensure_style (imhtml->tip_window); - layout = gtk_widget_create_pango_layout(imhtml->tip_window, imhtml->tip); + + /* We set the text in a separate function call so we can specify a + max length. This is important so the tooltip isn't too wide for + the screen, and also because some X library function exits the + process when it can't allocate enough memory for a super wide + tooltip. */ + layout = gtk_widget_create_pango_layout(imhtml->tip_window, NULL); + pango_layout_set_text(layout, imhtml->tip, 200); + font = pango_context_load_font(pango_layout_get_context(layout), style->font_desc);