After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 645019 - St toolkit doesn't handle X11 selection paste
St toolkit doesn't handle X11 selection paste
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: st
2.91.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 649628 656874 660810 680886 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-03-17 14:02 UTC by Frederic Crozat
Modified: 2013-02-07 09:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
StClipboard: Add the ability to choose the clipboard type (6.24 KB, patch)
2011-11-10 20:46 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
StEntry: Implement middle click paste (3.46 KB, patch)
2011-11-10 20:46 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
st-clipboard: Add the ability to choose the clipboard type (6.29 KB, patch)
2013-01-27 03:51 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
st-entry: Implement middle click paste (1.62 KB, patch)
2013-01-27 03:51 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
st-clipboard: Add the ability to choose the clipboard type (6.52 KB, patch)
2013-01-27 18:35 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
st-entry: Implement middle click paste (1.83 KB, patch)
2013-01-28 17:05 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Frederic Crozat 2011-03-17 14:02:37 UTC
When trying to paste using middle button on a St entry field (alt-f2 for instance), nothing happens.
Comment 1 Florian Müllner 2011-03-17 14:30:44 UTC
Gut feeling says that this is actually a ClutterEntry issue.
Comment 2 Florian Müllner 2011-05-07 08:48:46 UTC
*** Bug 649628 has been marked as a duplicate of this bug. ***
Comment 3 Rui Matos 2011-08-19 12:59:10 UTC
*** Bug 656874 has been marked as a duplicate of this bug. ***
Comment 4 Jasper St. Pierre (not reading bugmail) 2011-10-03 18:21:36 UTC
*** Bug 660810 has been marked as a duplicate of this bug. ***
Comment 5 Jean-André Santoni 2011-11-10 08:16:54 UTC
Can we confirm this bug? Or do we have to fill a bug report in Clutter?
Comment 6 Jasper St. Pierre (not reading bugmail) 2011-11-10 20:46:28 UTC
Created attachment 201187 [details] [review]
StClipboard: Add the ability to choose the clipboard type
Comment 7 Jasper St. Pierre (not reading bugmail) 2011-11-10 20:46:32 UTC
Created attachment 201188 [details] [review]
StEntry: Implement middle click paste
Comment 8 André Klapper 2012-01-10 14:12:54 UTC
Can these patches get a review?
Comment 9 Rui Matos 2012-01-18 23:57:15 UTC
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.
Comment 10 Rui Matos 2012-01-19 01:59:21 UTC
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.
Comment 11 Florian Müllner 2012-07-31 12:34:06 UTC
*** Bug 680886 has been marked as a duplicate of this bug. ***
Comment 12 Jasper St. Pierre (not reading bugmail) 2013-01-27 03:51:24 UTC
Created attachment 234505 [details] [review]
st-clipboard: Add the ability to choose the clipboard type
Comment 13 Jasper St. Pierre (not reading bugmail) 2013-01-27 03:51:27 UTC
Created attachment 234506 [details] [review]
st-entry: Implement middle click paste
Comment 14 Rui Matos 2013-01-27 18:23:24 UTC
Review of attachment 234505 [details] [review]:

Still missing the ClipboardType argument in _onCopyActivated's call to set_text()
Comment 15 Jasper St. Pierre (not reading bugmail) 2013-01-27 18:35:26 UTC
Created attachment 234558 [details] [review]
st-clipboard: Add the ability to choose the clipboard type
Comment 16 Rui Matos 2013-01-27 18:39:20 UTC
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.
Comment 17 Rui Matos 2013-01-27 18:50:31 UTC
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.
Comment 18 Matthias Clasen 2013-01-28 11:34:38 UTC
To be consistent with gtk, you should respect the setting to disable middle-button paste
Comment 19 Jasper St. Pierre (not reading bugmail) 2013-01-28 17:05:11 UTC
Created attachment 234634 [details] [review]
st-entry: Implement middle click paste
Comment 20 Rui Matos 2013-02-07 09:29:46 UTC
Review of attachment 234558 [details] [review]:

Seems fine
Comment 21 Rui Matos 2013-02-07 09:50:54 UTC
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.
Comment 22 Jasper St. Pierre (not reading bugmail) 2013-02-07 09:51:58 UTC
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