# HG changeset patch # User Luke Schierer # Date 1049931353 0 # Node ID 04ded2f7253c47d6226792f325734660589b450d # Parent 4596276f5b12c8ea54071acf149240f917972724 [gaim-migrate @ 5453] Ari Pollak (sourceo) writes: "If you hover over a link, a tooltip will generally pop up with the URL that is linked. If you then right-click on the link, the tooltip is still there, and can possibly cover over the right-click context menu. This patch simply closes the tooltip when right-clicking on a link." committer: Tailor Script diff -r 4596276f5b12 -r 04ded2f7253c src/gtkimhtml.c --- a/src/gtkimhtml.c Wed Apr 09 23:33:21 2003 +0000 +++ b/src/gtkimhtml.c Wed Apr 09 23:35:53 2003 +0000 @@ -297,7 +297,7 @@ } /* The callback for an event on a link tag. */ -gboolean tag_event(GtkTextTag *tag, GObject *arg1, GdkEvent *event, GtkTextIter *arg2, char *url) { +gboolean tag_event(GtkTextTag *tag, GObject *imhtml, GdkEvent *event, GtkTextIter *arg2, char *url) { GdkEventButton *event_button = (GdkEventButton *) event; if (event->type == GDK_BUTTON_RELEASE) { @@ -312,14 +312,24 @@ /* A link was clicked--we emit the "url_clicked" signal * with the URL as the argument */ - g_signal_emit(arg1, signals[URL_CLICKED], 0, url); + g_signal_emit(imhtml, signals[URL_CLICKED], 0, url); return FALSE; } else if(event_button->button == 3) { GtkWidget *img, *item, *menu; struct url_data *tempdata = g_new(struct url_data, 1); - tempdata->object = g_object_ref(arg1); + tempdata->object = g_object_ref(imhtml); tempdata->url = g_strdup(url); + /* Don't want the tooltip around if user right-clicked on link */ + if (GTK_IMHTML(imhtml)->tip_window) { + gtk_widget_destroy(GTK_IMHTML(imhtml)->tip_window); + GTK_IMHTML(imhtml)->tip_window = NULL; + } + if (GTK_IMHTML(imhtml)->tip_timer) { + g_source_remove(GTK_IMHTML(imhtml)->tip_timer); + GTK_IMHTML(imhtml)->tip_timer = 0; + } + gdk_window_set_cursor(event_button->window, GTK_IMHTML(imhtml)->arrow_cursor); menu = gtk_menu_new(); /* buttons and such */