changeset 5091:04ded2f7253c

[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 <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 09 Apr 2003 23:35:53 +0000
parents 4596276f5b12
children a4ad609ee6b3
files src/gtkimhtml.c
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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 */