Mercurial > pidgin.yaz
diff src/gtkimhtml.c @ 4944:5fe846b7603f
[gaim-migrate @ 5278]
Fixes by Rob "Robot101" McQueen:
Buddies who sign off within 10 seconds of signing on won't get stuck "online"
forever
Idle times refresh every minute
Show icons/text on the buddy list buttons works now
URL tooltips in gtkimhtml won't linger around for no good reason.
Thanks, Rob.
And Rob Flynn is a spoil sport ;)
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Tue, 01 Apr 2003 07:57:13 +0000 |
parents | 20c737bc03d7 |
children | 24c9a23df63b |
line wrap: on
line diff
--- a/src/gtkimhtml.c Tue Apr 01 07:48:28 2003 +0000 +++ b/src/gtkimhtml.c Tue Apr 01 07:57:13 2003 +0000 @@ -54,6 +54,7 @@ #define TOOLTIP_TIMEOUT 500 static gboolean gtk_motion_event_notify(GtkWidget *imhtml, GdkEventMotion *event, gpointer user_data); +static gboolean gtk_leave_event_notify(GtkWidget *imhtml, GdkEventCrossing *event, gpointer user_data); static gboolean gtk_size_allocate_cb(GtkWidget *widget, GtkAllocation *alloc, gpointer user_data); static gint gtk_imhtml_tip (gpointer data); @@ -230,8 +231,10 @@ g_free, (GDestroyNotify)gtk_smiley_tree_destroy); imhtml->default_smilies = gtk_smiley_tree_new(); + g_signal_connect(G_OBJECT(imhtml), "size-allocate", G_CALLBACK(gtk_size_allocate_cb), NULL); g_signal_connect(G_OBJECT(imhtml), "motion-notify-event", G_CALLBACK(gtk_motion_event_notify), NULL); - g_signal_connect(G_OBJECT(imhtml), "size-allocate", G_CALLBACK(gtk_size_allocate_cb), NULL); + g_signal_connect(G_OBJECT(imhtml), "leave-notify-event", G_CALLBACK(gtk_leave_event_notify), NULL); + gtk_widget_add_events(GTK_WIDGET(imhtml), GDK_LEAVE_NOTIFY_MASK); imhtml->tip = NULL; imhtml->tip_timer = 0; @@ -393,6 +396,23 @@ return FALSE; } +gboolean gtk_leave_event_notify(GtkWidget *imhtml, GdkEventCrossing *event, gpointer data) +{ + /* when leaving the widget, clear any current & pending tooltips and restore the cursor */ + 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->window, GTK_IMHTML(imhtml)->arrow_cursor); + + /* propogate the event normally */ + return FALSE; +} + /* this isn't used yet static void gtk_smiley_tree_remove (GtkSmileyTree *tree,