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 612119 - Do not scroll when middle pasting
Do not scroll when middle pasting
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.19.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
: 575251 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-03-07 19:58 UTC by Ignacio Casal Quinteiro (nacho)
Modified: 2010-03-31 00:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
middle click (2.29 KB, patch)
2010-03-07 19:59 UTC, Ignacio Casal Quinteiro (nacho)
none Details | Review
Patch to make the cursor move to the insert location when text is pasted by middle clicking (2.51 KB, patch)
2010-03-29 14:54 UTC, Michael T
none Details | Review
Do not loose the contents of the PRIMARY selection, even when text in a buffer is de-selected (1.34 KB, patch)
2010-03-31 00:12 UTC, Michael T
none Details | Review

Description Ignacio Casal Quinteiro (nacho) 2010-03-07 19:58:39 UTC
Patch following.
Comment 1 Ignacio Casal Quinteiro (nacho) 2010-03-07 19:59:18 UTC
Created attachment 155492 [details] [review]
middle click

This should fix the issue
Comment 2 Matthias Clasen 2010-03-08 16:30:00 UTC
A bit sad that we have to add this extra flag, while the text buffer knows the difference perfectly well. But too late to add an extra flag to the signal now...
Comment 3 Ignacio Casal Quinteiro (nacho) 2010-03-08 22:57:12 UTC
*** Bug 575251 has been marked as a duplicate of this bug. ***
Comment 4 Michael T 2010-03-19 08:40:46 UTC
To my mind this is still not quite right.  Most applications move the cursor to the paste location when you paste, and at least the version of gedit in Ubuntu Lucid does not (or is it too old?)  Would that also seem like reasonable behaviour to you?
Comment 5 Michael T 2010-03-29 14:54:57 UTC
Created attachment 157384 [details] [review]
Patch to make the cursor move to the insert location when text is pasted by middle clicking

I can't re-open this ticket, it seems, but here is a patch to make middle-button pasting work the way I described above, which seems to match most other applications.
Comment 6 Michael T 2010-03-29 14:56:14 UTC
Ignacio, sorry that my patch almost completely reverts your one, but without yours as a starting point I would never have been able to produce it anyway :)
Comment 7 Ignacio Casal Quinteiro (nacho) 2010-03-29 15:48:01 UTC
Moving the curson when pasting is ok but not when middle click paste as you would loose the current selection. That's the why of the current behavior. Thanks for your patch anyway, but I'd say it is not right.
Comment 8 Michael T 2010-03-29 16:14:20 UTC
A quick test shows that Epiphany, Firefox and Emacs do behave like this, moving the cursor and unselecting the current selection on middle click.  The difference is that they still remember the contents of the paste buffer, even though the text is no longer selected, so that you can repeatedly middle click.
Comment 9 Michael T 2010-03-29 16:15:38 UTC
I would say though that that is a different issue, and that an application that puts something in the paste buffer should remember what it put there until someone else puts something in it or some other text is selected.
Comment 10 Michael T 2010-03-31 00:12:55 UTC
Created attachment 157548 [details] [review]
Do not loose the contents of the PRIMARY selection, even when text in a buffer is de-selected

This patch prevents the contents of PRIMARY from getting lost when the selection in the text buffer goes away, making its behaviour match standard X11 practice.  This is obviously *not* intended as something final (but I'm not at all sure that you agree with the need for this...), but rather as a basis.  Ideally, a final patch should not duplicate the clipboard object among different clipboards, including CLIPBOARD.