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 127705 - GtkTextView: middle mouse button paste behavior is inconsistent with other *NIX apps
GtkTextView: middle mouse button paste behavior is inconsistent with other *N...
Status: RESOLVED DUPLICATE of bug 81880
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.4.x
Other Linux
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-11-22 22:28 UTC by Julian Lamb
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Julian Lamb 2003-11-22 22:28:36 UTC
The MMB paste behavior is a little different from other apps.  In gedit:

1. highlight some text
2. move mouse pointer to another location
3. click middle mouse button

the highlighted text is copied to the new location, but the original text
is still highlighted.  If you begin typing, this original text is deleted.

In most other GNOME apps, the highlighted text is copied, but then
un-highlighted and the cursor jumps to the end of the pasted text.  The
user can then immendiately begin typing after the pasted code.

Of course, I'm sure this is a user preference, but it is inconsistent with
most other *NIX apps, and it's a little annoying to one that has become
accustomed to the standard behavior.

Cheers--
Comment 1 Paolo Maggi 2003-12-30 17:46:38 UTC
Which other GNOME apps?

This is a GtkTextView/Buffer problem.

Changing the summary too.
Comment 2 Paolo Maggi 2003-12-30 17:52:23 UTC
Sorry for the spam.
Comment 3 Julian Lamb 2004-01-05 03:21:57 UTC
    Abiword and Anjuta, for example (also XEmacs...and now that I
think of it, the HTML text entry box that I'm currently typing into on
Galeon is another example...).  No matter where the cursor is on these
applications, it will always move to the end of the pasted text after
the middle mouse button is pressed.  With the GtkTextView widget, the
cursor stays where it was before the paste.  

Hope this helps---
Comment 4 Paolo Maggi 2004-02-26 11:07:38 UTC

*** This bug has been marked as a duplicate of 81880 ***
Comment 5 Paolo Borelli 2004-02-26 16:05:28 UTC
The following patch seems to fix it:

in gtktextbuffer during pre_paste_prep we move the "insert" mark at
the insertion point

in gtktextview after having pasted the text we retrieve the "insert"
mark and move the cursor to it making sure of also scroll the window
if needed.

(note that we cannot simply move the cursor to the iter retrieved at
the button click because the clipboard would be emptied)
Comment 6 Paolo Borelli 2004-02-26 16:08:09 UTC
Oh well, mid air collision... posting the patch in the other bug