GNOME Bugzilla – Bug 645019
St toolkit doesn't handle X11 selection paste
Last modified: 2013-02-07 09:52:05 UTC
When trying to paste using middle button on a St entry field (alt-f2 for instance), nothing happens.
Gut feeling says that this is actually a ClutterEntry issue.
*** Bug 649628 has been marked as a duplicate of this bug. ***
*** Bug 656874 has been marked as a duplicate of this bug. ***
*** Bug 660810 has been marked as a duplicate of this bug. ***
Can we confirm this bug? Or do we have to fill a bug report in Clutter?
Created attachment 201187 [details] [review] StClipboard: Add the ability to choose the clipboard type
Created attachment 201188 [details] [review] StEntry: Implement middle click paste
Can these patches get a review?
Review of attachment 201187 [details] [review]: The set_text() call in _onCopyActivated needs the new argument too. With that added and that empty line removed this looks good. ::: src/st/st-clipboard.c @@ +198,3 @@ dpy = clutter_x11_get_default_display (); + Empty line.
Review of attachment 201188 [details] [review]: ::: src/st/st-entry.c @@ +532,3 @@ } static void Should return gboolean. @@ +546,3 @@ + g_signal_stop_emission_by_name (actor, "button-press-event"); + + CLUTTER_ACTOR_CLASS (ST_IM_TEXT_GET_CLASS (actor))->button_press_event (actor, event); This stuff isn't needed, see below. @@ +549,3 @@ + + /* OK, at this point, clutter_text_button_press has run, + * meaning that the cursor position is where we want it */ If you always return FALSE from this function the class closure will run after it and by the time the clipboard callback is called the cursor will already be at the correct position.
*** Bug 680886 has been marked as a duplicate of this bug. ***
Created attachment 234505 [details] [review] st-clipboard: Add the ability to choose the clipboard type
Created attachment 234506 [details] [review] st-entry: Implement middle click paste
Review of attachment 234505 [details] [review]: Still missing the ClipboardType argument in _onCopyActivated's call to set_text()
Created attachment 234558 [details] [review] st-clipboard: Add the ability to choose the clipboard type
Review of attachment 234506 [details] [review]: ::: src/st/st-entry.c @@ +557,3 @@ + st_entry_clipboard_callback, + user_data); + } Actually, to be consistent with gtk+'s behavior we shouldn't try to move the text cursor before inserting the characters, so I'd prefer to just return TRUE here.
To be complete we should also set the PRIMARY selection when text is selected. Finally, I wonder if we want this enabled by default? What do the designers think? I've seen some complaints here and there that we should actually stop using the PRIMARY selection in GNOME as whole since it's easy to trigger accidentally.
To be consistent with gtk, you should respect the setting to disable middle-button paste
Created attachment 234634 [details] [review] st-entry: Implement middle click paste
Review of attachment 234558 [details] [review]: Seems fine
Review of attachment 234634 [details] [review]: With that fixed seems good. Note that for full functionality we are still missing setting the PRIMARY selection when text is selected in the entry. ::: src/st/st-entry.c @@ +551,3 @@ + + g_object_get (settings, "gtk-enable-primary-paste", + &primary_paste_enabled); Needs to be NULL terminated.
Attachment 234558 [details] pushed as 0616261 - st-clipboard: Add the ability to choose the clipboard type Attachment 234634 [details] pushed as eaf184b - st-entry: Implement middle click paste