Mercurial > pidgin.yaz
diff pidgin/gtkimhtml.c @ 27768:969a2aeae461
propagate from branch 'im.pidgin.pidgin' (head b7875f81b48bb1a776ac4b2473cc7376cb35b0f9)
to branch 'im.pidgin.pidgin.yaz' (head e22890a44520ea1129da935f8ce82ea795081201)
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 27 Feb 2008 12:21:29 +0000 |
parents | e9cf897bd873 |
children | 085d0a18a7f7 |
line wrap: on
line diff
--- a/pidgin/gtkimhtml.c Wed Feb 27 09:18:06 2008 +0000 +++ b/pidgin/gtkimhtml.c Wed Feb 27 12:21:29 2008 +0000 @@ -90,6 +90,10 @@ gint y, guint time); +/* yaz. If you want to use shortcut keys that may conflict with + inputmethods, change this to 1. */ +#define ENABLE_SHORTCUT 0 + static void preinsert_cb(GtkTextBuffer *buffer, GtkTextIter *iter, gchar *text, gint len, GtkIMHtml *imhtml); static void insert_cb(GtkTextBuffer *buffer, GtkTextIter *iter, gchar *text, gint len, GtkIMHtml *imhtml); static void delete_cb(GtkTextBuffer *buffer, GtkTextIter *iter, GtkTextIter *end, GtkIMHtml *imhtml); @@ -416,10 +420,11 @@ static gint gtk_imhtml_tip (gpointer data) { - GtkIMHtml *imhtml = data; + GtkIMHtml *imhtml = (GtkIMHtml *)data; PangoFontMetrics *font_metrics; PangoLayout *layout; PangoFont *font; + PangoLanguage *lang; gint gap, x, y, h, w, scr_w, baseline_skip; @@ -460,7 +465,9 @@ return FALSE; } - font_metrics = pango_font_get_metrics(font, NULL); + lang = pango_context_get_language (pango_layout_get_context(layout)); + font_metrics = pango_font_get_metrics(font, lang); //it's ok. +// font_metrics = pango_font_get_metrics(font, NULL); //crash! pango_layout_get_pixel_size(layout, &scr_w, NULL); gap = PANGO_PIXELS((pango_font_metrics_get_ascent(font_metrics) + @@ -575,14 +582,15 @@ tip = g_object_get_data(G_OBJECT(anchor), "gtkimhtml_plaintext"); hand = FALSE; } - +//yaz here bomb explodes +#if 1 if (tip){ if (!GTK_IMHTML(imhtml)->editable && hand) gdk_window_set_cursor(win, GTK_IMHTML(imhtml)->hand_cursor); GTK_IMHTML(imhtml)->tip_timer = g_timeout_add (TOOLTIP_TIMEOUT, gtk_imhtml_tip, imhtml); } - +#endif GTK_IMHTML(imhtml)->tip = tip; g_slist_free(tags); return FALSE;