changeset 22900:c9aebd4762a8

Middle click pastes the internal clipboard
author Richard Nelson <wabz@pidgin.im>
date Sun, 11 May 2008 07:24:59 +0000
parents 24dfef623410
children ab1e99cb4ced 2e3c67ac2fd7
files ChangeLog finch/libgnt/gntentry.c
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun May 11 07:20:42 2008 +0000
+++ b/ChangeLog	Sun May 11 07:24:59 2008 +0000
@@ -54,6 +54,8 @@
 	Finch:
 	* New default binding ctrl+x to open context menus.
 	* Menu triggers and other bindings will no longer conflict.
+	* Middle click pastes the internal clipboard (when mouse support is
+	  enabled).
 
 version 2.4.1 (03/31/2008):
 	http://developer.pidgin.im/query?status=closed&milestone=2.4.1
--- a/finch/libgnt/gntentry.c	Sun May 11 07:20:42 2008 +0000
+++ b/finch/libgnt/gntentry.c	Sun May 11 07:24:59 2008 +0000
@@ -839,6 +839,17 @@
 	entry_redraw(widget);
 }
 
+static gboolean
+gnt_entry_clicked(GntWidget *widget, GntMouseEvent event, int x, int y)
+{
+	if (event == GNT_MIDDLE_MOUSE_DOWN) {
+		clipboard_paste(GNT_BINDABLE(widget), NULL);
+		return TRUE;
+	}
+	return FALSE;
+
+}
+
 static void
 gnt_entry_class_init(GntEntryClass *klass)
 {
@@ -846,6 +857,7 @@
 	char s[2] = {erasechar(), 0};
 
 	parent_class = GNT_WIDGET_CLASS(klass);
+	parent_class->clicked = gnt_entry_clicked;
 	parent_class->destroy = gnt_entry_destroy;
 	parent_class->draw = gnt_entry_draw;
 	parent_class->map = gnt_entry_map;