FreeBSD Bugzilla – Attachment 149723 Details for
Bug 188264
[patch] No way to paste primary selection in GTK Programs using x11-toolkits/gtk20 and x11/toolkits/gtk30
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
x11-toolkits/gtk20, upstream version
gtk2-selection.diff (text/plain), 10.94 KB, created by
Jan Beich
on 2014-11-22 18:05:46 UTC
(
hide
)
Description:
x11-toolkits/gtk20, upstream version
Filename:
MIME Type:
Creator:
Jan Beich
Created:
2014-11-22 18:05:46 UTC
Size:
10.94 KB
patch
obsolete
>Index: x11-toolkits/gtk20/Makefile >=================================================================== >--- x11-toolkits/gtk20/Makefile (revision 373082) >+++ x11-toolkits/gtk20/Makefile (working copy) >@@ -40,7 +40,7 @@ CPPFLAGS+= -I${LOCALBASE}/include > LDFLAGS+= -L${LOCALBASE}/lib > INSTALL_TARGET= install-strip > >-OPTIONS_DEFINE= CUPS DEBUG >+OPTIONS_DEFINE= CUPS DEBUG SHIFT_INSERT > OPTIONS_DEFAULT=CUPS > OPTIONS_SUB= yes > >@@ -48,6 +48,8 @@ CUPS_LIB_DEPENDS= libcups.so:${PORTSDIR}/print/cup > CUPS_CONFIGURE_ON= --enable-cups=auto > CUPS_CONFIGURE_OFF= --disable-cups > DEBUG_CONFIGURE_ON= --enable-debug=yes >+SHIFT_INSERT_DESC= Use Shift-Insert to paste primary selection >+SHIFT_INSERT_EXTRA_PATCHES= ${FILESDIR}/extra-patch-shift-insert > > .include <bsd.port.options.mk> > >Index: x11-toolkits/gtk20/files/extra-patch-shift-insert >=================================================================== >--- x11-toolkits/gtk20/files/extra-patch-shift-insert (revision 0) >+++ x11-toolkits/gtk20/files/extra-patch-shift-insert (working copy) >@@ -0,0 +1,24 @@ >+--- gtk/gtktextview.c~ >++++ gtk/gtktextview.c >+@@ -1255,7 +1255,8 @@ gtk_text_view_class_init (GtkTextViewCla >+ gtk_binding_entry_add_signal (binding_set, GDK_Insert, GDK_CONTROL_MASK, >+ "copy-clipboard", 0); >+ gtk_binding_entry_add_signal (binding_set, GDK_Insert, GDK_SHIFT_MASK, >+- "paste-clipboard", 0); >++ "paste-selection", 1, >++ G_TYPE_STRING, "primary"); >+ >+ /* Overwrite */ >+ gtk_binding_entry_add_signal (binding_set, GDK_Insert, 0, >+--- gtk/gtkentry.c~ >++++ gtk/gtkentry.c >+@@ -1720,7 +1720,8 @@ gtk_entry_class_init (GtkEntryClass *cla >+ gtk_binding_entry_add_signal (binding_set, GDK_Insert, GDK_CONTROL_MASK, >+ "copy-clipboard", 0); >+ gtk_binding_entry_add_signal (binding_set, GDK_Insert, GDK_SHIFT_MASK, >+- "paste-clipboard", 0); >++ "paste-selection", 1, >++ G_TYPE_STRING, "primary"); >+ >+ /* Overwrite */ >+ gtk_binding_entry_add_signal (binding_set, GDK_Insert, 0, > >Property changes on: x11-toolkits/gtk20/files/extra-patch-shift-insert >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: x11-toolkits/gtk20/files/patch-gnome-bug643391 >=================================================================== >--- x11-toolkits/gtk20/files/patch-gnome-bug643391 (revision 0) >+++ x11-toolkits/gtk20/files/patch-gnome-bug643391 (working copy) >@@ -0,0 +1,224 @@ >+From 1362bbc140d6853307a7127aead766b001b613b6 Mon Sep 17 00:00:00 2001 >+From: Andy Spencer <andy753421@gmail.com> >+Date: Sun, 27 Feb 2011 01:52:06 +0000 >+Subject: [PATCH 1/1] Add "paste-selection" keybind signal >+ >+This allows (re)binding a key to paste the PRIMARY and/or SECONDARY >+selections under X11. >+--- >+ gtk/gtkentry.c | 42 ++++++++++++++++++++++++++++++++++++++++++ >+ gtk/gtkentry.h | 4 +++- >+ gtk/gtktextview.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ >+ gtk/gtktextview.h | 4 +++- >+ 4 files changed, 96 insertions(+), 2 deletions(-) >+ >+diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c >+index dd509c2..2066952 100644 >+--- gtk/gtkentry.c >++++ gtk/gtkentry.c >+@@ -168,6 +168,7 @@ enum { >+ CUT_CLIPBOARD, >+ COPY_CLIPBOARD, >+ PASTE_CLIPBOARD, >++ PASTE_SELECTION, >+ TOGGLE_OVERWRITE, >+ ICON_PRESS, >+ ICON_RELEASE, >+@@ -382,6 +383,8 @@ static void gtk_entry_backspace (GtkEntry *entry); >+ static void gtk_entry_cut_clipboard (GtkEntry *entry); >+ static void gtk_entry_copy_clipboard (GtkEntry *entry); >+ static void gtk_entry_paste_clipboard (GtkEntry *entry); >++static void gtk_entry_paste_selection (GtkEntry *entry, >++ const gchar *which); >+ static void gtk_entry_toggle_overwrite (GtkEntry *entry); >+ static void gtk_entry_select_all (GtkEntry *entry); >+ static void gtk_entry_real_activate (GtkEntry *entry); >+@@ -615,6 +618,7 @@ gtk_entry_class_init (GtkEntryClass *class) >+ class->cut_clipboard = gtk_entry_cut_clipboard; >+ class->copy_clipboard = gtk_entry_copy_clipboard; >+ class->paste_clipboard = gtk_entry_paste_clipboard; >++ class->paste_selection = gtk_entry_paste_selection; >+ class->toggle_overwrite = gtk_entry_toggle_overwrite; >+ class->activate = gtk_entry_real_activate; >+ class->get_text_area_size = gtk_entry_get_text_area_size; >+@@ -1489,6 +1493,25 @@ gtk_entry_class_init (GtkEntryClass *class) >+ G_TYPE_NONE, 0); >+ >+ /** >++ * GtkEntry::paste-selection: >++ * @entry: the object which received the signal >++ * >++ * The ::paste-selection signal is a >++ * <link linkend="keybinding-signals">keybinding signal</link> >++ * which gets emitted to paste the contents of the given selection >++ * into the entry. >++ */ >++ signals[PASTE_SELECTION] = >++ g_signal_new (I_("paste-selection"), >++ G_OBJECT_CLASS_TYPE (gobject_class), >++ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, >++ G_STRUCT_OFFSET (GtkEntryClass, paste_selection), >++ NULL, NULL, >++ _gtk_marshal_VOID__STRING, >++ G_TYPE_NONE, 1, >++ G_TYPE_STRING); >++ >++ /** >+ * GtkEntry::toggle-overwrite: >+ * @entry: the object which received the signal >+ * >+@@ -5094,6 +5117,25 @@ gtk_entry_paste_clipboard (GtkEntry *entry) >+ } >+ >+ static void >++gtk_entry_paste_selection (GtkEntry *entry, >++ const gchar *which) >++{ >++ if (entry->editable) >++ { >++ if (g_str_equal(which, "primary")) >++ gtk_entry_paste (entry, GDK_SELECTION_PRIMARY); >++ else if (g_str_equal(which, "secondary")) >++ gtk_entry_paste (entry, GDK_SELECTION_SECONDARY); >++ else if (g_str_equal(which, "clipboard")) >++ gtk_entry_paste (entry, GDK_SELECTION_CLIPBOARD); >++ else >++ gtk_widget_error_bell (GTK_WIDGET (entry)); >++ } >++ else >++ gtk_widget_error_bell (GTK_WIDGET (entry)); >++} >++ >++static void >+ gtk_entry_delete_cb (GtkEntry *entry) >+ { >+ GtkEditable *editable = GTK_EDITABLE (entry); >+diff --git a/gtk/gtkentry.h b/gtk/gtkentry.h >+index 9bbba0b..21c0ca4 100644 >+--- gtk/gtkentry.h >++++ gtk/gtkentry.h >+@@ -158,9 +158,11 @@ struct _GtkEntryClass >+ gint *width, >+ gint *height); >+ >++ void (* paste_selection) (GtkEntry *entry, >++ const gchar *which); >++ >+ /* Padding for future expansion */ >+ void (*_gtk_reserved1) (void); >+- void (*_gtk_reserved2) (void); >+ }; >+ >+ GType gtk_entry_get_type (void) G_GNUC_CONST; >+diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c >+index 9a2edc0..c9cd014 100644 >+--- gtk/gtktextview.c >++++ gtk/gtktextview.c >+@@ -135,6 +135,7 @@ enum >+ CUT_CLIPBOARD, >+ COPY_CLIPBOARD, >+ PASTE_CLIPBOARD, >++ PASTE_SELECTION, >+ TOGGLE_OVERWRITE, >+ MOVE_VIEWPORT, >+ SELECT_ALL, >+@@ -281,6 +282,8 @@ static void gtk_text_view_backspace (GtkTextView *text_view); >+ static void gtk_text_view_cut_clipboard (GtkTextView *text_view); >+ static void gtk_text_view_copy_clipboard (GtkTextView *text_view); >+ static void gtk_text_view_paste_clipboard (GtkTextView *text_view); >++static void gtk_text_view_paste_selection (GtkTextView *text_view, >++ const gchar *which); >+ static void gtk_text_view_toggle_overwrite (GtkTextView *text_view); >+ static void gtk_text_view_toggle_cursor_visible (GtkTextView *text_view); >+ static void gtk_text_view_compat_move_focus(GtkTextView *text_view, >+@@ -532,6 +535,7 @@ gtk_text_view_class_init (GtkTextViewClass *klass) >+ klass->cut_clipboard = gtk_text_view_cut_clipboard; >+ klass->copy_clipboard = gtk_text_view_copy_clipboard; >+ klass->paste_clipboard = gtk_text_view_paste_clipboard; >++ klass->paste_selection = gtk_text_view_paste_selection; >+ klass->toggle_overwrite = gtk_text_view_toggle_overwrite; >+ klass->move_focus = gtk_text_view_compat_move_focus; >+ klass->set_scroll_adjustments = gtk_text_view_set_scroll_adjustments; >+@@ -947,6 +951,25 @@ gtk_text_view_class_init (GtkTextViewClass *klass) >+ G_TYPE_NONE, 0); >+ >+ /** >++ * GtkTextView::paste-selection: >++ * @text_view: the object which received the signal >++ * >++ * The ::paste-selection signal is a >++ * <link linkend="keybinding-signals">keybinding signal</link> >++ * which gets emitted to paste the contents of the given selection >++ * into the text view. >++ */ >++ signals[PASTE_SELECTION] = >++ g_signal_new (I_("paste-selection"), >++ G_OBJECT_CLASS_TYPE (gobject_class), >++ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, >++ G_STRUCT_OFFSET (GtkTextViewClass, paste_selection), >++ NULL, NULL, >++ _gtk_marshal_VOID__STRING, >++ G_TYPE_NONE, 1, >++ G_TYPE_STRING); >++ >++ /** >+ * GtkTextView::toggle-overwrite: >+ * @text_view: the object which received the signal >+ * >+@@ -5818,6 +5841,31 @@ gtk_text_view_paste_clipboard (GtkTextView *text_view) >+ } >+ >+ static void >++gtk_text_view_paste_selection (GtkTextView *text_view, >++ const gchar *which) >++{ >++ GtkClipboard *clipboard = NULL; >++ >++ if (g_str_equal (which, "primary")) >++ clipboard = gtk_widget_get_clipboard (GTK_WIDGET (text_view), >++ GDK_SELECTION_PRIMARY); >++ else if (g_str_equal (which, "secondary")) >++ clipboard = gtk_widget_get_clipboard (GTK_WIDGET (text_view), >++ GDK_SELECTION_SECONDARY); >++ else if (g_str_equal (which, "clipboard")) >++ clipboard = gtk_widget_get_clipboard (GTK_WIDGET (text_view), >++ GDK_SELECTION_CLIPBOARD); >++ >++ if (clipboard) >++ gtk_text_buffer_paste_clipboard (get_buffer (text_view), >++ clipboard, >++ NULL, >++ text_view->editable); >++ else >++ gtk_widget_error_bell (GTK_WIDGET (text_view)); >++} >++ >++static void >+ gtk_text_view_paste_done_handler (GtkTextBuffer *buffer, >+ GtkClipboard *clipboard, >+ gpointer data) >+diff --git a/gtk/gtktextview.h b/gtk/gtktextview.h >+index c3fa802..eacd734 100644 >+--- gtk/gtktextview.h >++++ gtk/gtktextview.h >+@@ -204,6 +204,9 @@ struct _GtkTextViewClass >+ void (* move_focus) (GtkTextView *text_view, >+ GtkDirectionType direction); >+ >++ void (* paste_selection) (GtkTextView *text_view, >++ const gchar *which); >++ >+ /* Padding for future expansion */ >+ void (*_gtk_reserved1) (void); >+ void (*_gtk_reserved2) (void); >+@@ -211,7 +214,6 @@ struct _GtkTextViewClass >+ void (*_gtk_reserved4) (void); >+ void (*_gtk_reserved5) (void); >+ void (*_gtk_reserved6) (void); >+- void (*_gtk_reserved7) (void); >+ }; >+ >+ GType gtk_text_view_get_type (void) G_GNUC_CONST; >+-- >+1.7.3.4 >+ > >Property changes on: x11-toolkits/gtk20/files/patch-gnome-bug643391 >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 188264
:
141456
|
148305
|
148306
|
148459
|
148460
|
149715
|
149716
| 149723 |
149724
|
151732