GNOME Bugzilla – Bug 612119
Do not scroll when middle pasting
Last modified: 2010-03-31 00:12:55 UTC
Patch following.
Created attachment 155492 [details] [review] middle click This should fix the issue
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...
*** Bug 575251 has been marked as a duplicate of this bug. ***
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?
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.
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 :)
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.
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.
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.
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.