Text gets erroneously copied to the clipboard in GTK based applications

Bug #380907 reported by Craig Fowler
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xorg (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Using Kubuntu Jaunty/KDE 4.2.2

Problem
=======
Selecting text gets hijacked by some kind of clipboard action and "what I select" gets copied to the clipboard and the selection cleared.

To Reproduce
============
I can reproduce this in one of two ways:
1) With the mouse, drag a selection over some text. If I pause selecting for [don't know exact time, but less than a second] then *even without releasing the mouse button* the selection is cleared and the selected text is copied to the clipboard.

2) Using the keyboard, holding down shift and using arrow keys to select text. Agsin, if I pause (IE: don't press an arrow key for a moment) but I'm still holding down the shift key, the selection is cleared and the selected text is copied to the clipboard.

Affected Apps
=============
I can only reproduce this behavior on a few applications:

* Monodevelop
* XChat
   I know that selecting text in the chat buffer is supposed to immediately copy in xchat, but I can reproduce this behaviour in the 'text entry' input control, which shouldn't exhibit that behaviour.
* Pidgin
   Only in the 'text entry' input control of a conversation window, not in the chat buffer.
* Gedit

I have tried reproducing the behaviour in:
* Kate
* Konqueror
* A 'standard KDE file open dialog'
and was not able to.

As far as I can see the pattern is that the affected apps all use GTK.

Other Info
==========
I have been able to reproduce this whether or not I am running klipper. Also, it happens regardless of klipper's setting: 'Ignore Selection'. When I am running klipper, I have it set on "Separate Selection and Clipboard".

In trying to troubleshoot the problem I have learned a bit about the difference between the PRIMARY selection and the CLIPBOARD selection. In all cases the 'hijacked selected text' gets copied to the clipboard and not the primary selection (IE: I could paste it with ctrl-v).

As far as a fix is concerned, if totally disabling xorg's primary selection method (select text then 'paste' with middle mouse button) fixes my issue (and it is possible to totally disable that behaviour) then I am perfectly happy with that solution. I don't use the primary selection functionality at all, ever. I even have middle mouse button bound to something totally different.

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.
Is this bug reproducible with the latest Lucid packages ?
Tanks in advance.

Changed in ubuntu:
status: New → Incomplete
Revision history for this message
Craig Fowler (craig-craigfowler) wrote :

Wow, I reported this 14 months ago and had forgotten about it.

In short this bug has no meaning to me anymore. After experiencing some other issues in (IIRC) Q3 2009 I abandoned Ubuntu and switched to Debian testing. I find that much more reliable than Ubuntu stable.

I can say though that I can't reproduce this in Debian testing. I assume that this means that [whatever made it right for me] in Debian should make its way downstream to Ubuntu at some point - if not already. Sorry I can't be more helpful but I don't have any Ubuntu machines left to try and reproduce this on.

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Thanks for the reply
In accord with reporter's reply and assignation policies I mark as Invalid
:)Fabio
Ubuntu still raising, try again..

Changed in ubuntu:
status: Incomplete → Invalid
Revision history for this message
gorilych (gorilych) wrote :

I'd like to reopen this bug. I am using Ubuntu 10.10 and Debian testing on different boxes and can reproduce the problem on both.

PROBLEM:

In GTK applications text selected by shift+arrows is copied into mouse selection.

To REPRODUCE:

1) Open GTK application, f.e. firefox and open some page with editable text area. Actually, I am doing this right now while filling 'Add comment' text area in bugs.launchpad.net.

2) Select some text with mouse. It will be copied into clipboard upon mouse button release, you can verify it by trying to paste it with middle-click. This is good and expected behaviour.

3) Now select some other text with shift+arrows.

ACTUAL RESULT

4) Text selected with shift+arrows will be copied into mouse clipboard. You can verify it by trying to paste it with middle-click. And this is not good.

EXPECTED RESULT is that mouse clipboard is changed only by mouse selection, and is not changed by step 3).

ADDITIONAL INFO:

This problem indeed does not affect Qt application. You can also see this problem when trying to rename file in nautilus by clicking F2. Nautilus will highlight file name and it will be copied into mouse selection buffer.

Changed in ubuntu:
status: Invalid → New
Revision history for this message
gorilych (gorilych) wrote :

small addition to steps 3) and 4) in comment #4 : copying into mouse selection buffer happens upon release of shift button.

Changed in ubuntu:
status: New → Confirmed
tags: added: jaunty maverick
affects: ubuntu → xorg (Ubuntu)
bugbot (bugbot)
tags: added: kubuntu
Revision history for this message
Bryce Harrington (bryce) wrote :

@gorilych, the behavior you describe is not what the original bug report was about.

Besides, AIUI that is the correct behavior according to the spec. You can talk to the X.org folks if you disagree but I think this is not going to be changed.

Changed in xorg (Ubuntu):
status: Confirmed → Won't Fix
Revision history for this message
gorilych (gorilych) wrote :

Hi Bruce,

> the behavior you describe is not what the original bug report was about.

You seems to be right.

> Besides, AIUI that is the correct behavior according to the spec.

I was not able to find docs on this at x.org. Do you know where I can read this? I will check it and will file another bug (something is definitely wrong, because the behaviour is *different* in GTK and Qt apps - you can reproduce in `gedit`, but not in `kate`)

Thank you.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.