Mercurial > pidgin
changeset 11059:c86d423df757
[gaim-migrate @ 13012]
enix came up with this (partial) workaround to GTK+ bug #107320, which was causing the tooltip window to obscure the right-click menu. I extended it to dragging.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Tue, 05 Jul 2005 03:08:49 +0000 |
parents | 9509ba09475f |
children | 52d6b10025ca |
files | src/gtkblist.c |
diffstat | 1 files changed, 34 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gtkblist.c Tue Jul 05 00:17:54 2005 +0000 +++ b/src/gtkblist.c Tue Jul 05 03:08:49 2005 +0000 @@ -136,6 +136,8 @@ static void redo_buddy_list(GaimBuddyList *list, gboolean remove); static void gaim_gtk_blist_collapse_contact_cb(GtkWidget *w, GaimBlistNode *node); +static void gaim_gtk_blist_tooltip_destroy(); + struct _gaim_gtk_blist_node { GtkTreeRowReference *row; gboolean contact_expanded; @@ -1497,6 +1499,16 @@ menu = create_buddy_menu(node, b); } +#ifdef _WIN32 + /* Unhook the tooltip-timeout since we don't want a tooltip + * to appear and obscure the context menu we are about to show + This is a workaround for GTK+ bug 107320. */ + if (gtkblist->timeout) { + g_source_remove(gtkblist->timeout); + gtkblist->timeout = 0; + } +#endif + /* Now display the menu */ if (menu != NULL) { gtk_widget_show_all(menu); @@ -1781,13 +1793,31 @@ return TRUE; } +#ifdef _WIN32 +static void gaim_gtk_blist_drag_begin(GtkWidget *widget, + GdkDragContext *drag_context, gpointer user_data) +{ + gaim_gtk_blist_tooltip_destroy(); + + + /* Unhook the tooltip-timeout since we don't want a tooltip + * to appear and obscure the dragging operation. + * This is a workaround for GTK+ bug 107320. */ + if (gtkblist->timeout) { + g_source_remove(gtkblist->timeout); + gtkblist->timeout = 0; + } +} +#endif + static void gaim_gtk_blist_drag_data_get_cb(GtkWidget *widget, GdkDragContext *dc, GtkSelectionData *data, guint info, guint time, - gpointer *null) + gpointer null) { + if (data->target == gdk_atom_intern("GAIM_BLIST_NODE", FALSE)) { GtkTreeRowReference *ref = g_object_get_data(G_OBJECT(dc), "gtk-tree-view-source-row"); @@ -3555,6 +3585,9 @@ g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-data-received", G_CALLBACK(gaim_gtk_blist_drag_data_rcv_cb), NULL); g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-data-get", G_CALLBACK(gaim_gtk_blist_drag_data_get_cb), NULL); +#ifdef _WIN32 + g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-begin", G_CALLBACK(gaim_gtk_blist_drag_begin), NULL); +#endif g_signal_connect(G_OBJECT(gtkblist->treeview), "drag-motion", G_CALLBACK(gaim_gtk_blist_drag_motion_cb), NULL);