# HG changeset patch # User Sadrul Habib Chowdhury # Date 1179264423 0 # Node ID b079dad9d5698eee61426875e3c1ff8627273d32 # Parent 31c49d31edeabb86306ec40cc56e72e1554d1da1 Stop propagating a middle-click on the pane-handle to the notebook below. diff -r 31c49d31edea -r b079dad9d569 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Tue May 15 17:19:47 2007 +0000 +++ b/pidgin/gtkconv.c Tue May 15 21:27:03 2007 +0000 @@ -4597,6 +4597,18 @@ } } +static gboolean +ignore_middle_click(GtkWidget *widget, GdkEventButton *e, gpointer null) +{ + /* A click on the pane is propagated to the notebook containing the pane. + * So if Stu accidentally aims high and middle clicks on the pane-handle, + * it causes a conversation tab to close. Let's stop that from happening. + */ + if (e->button == 2 && e->type == GDK_BUTTON_PRESS) + return TRUE; + return FALSE; +} + /************************************************************************** * Conversation UI operations **************************************************************************/ @@ -4670,6 +4682,8 @@ te, sizeof(te) / sizeof(GtkTargetEntry), GDK_ACTION_COPY); + g_signal_connect(G_OBJECT(pane), "button_press_event", + G_CALLBACK(ignore_middle_click), NULL); g_signal_connect(G_OBJECT(pane), "drag_data_received", G_CALLBACK(conv_dnd_recv), gtkconv); g_signal_connect(G_OBJECT(gtkconv->imhtml), "drag_data_received",