Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#3371 closed defect (fixed)

Bad interaction between Clipboard and TTS

Reported by: godiard Owned by: godiard
Priority: Unspecified by Maintainer Milestone:
Component: Sugar Version: Unspecified
Severity: Unspecified Keywords: 12.1.0
Cc: garycmartin Distribution/OS: Unspecified
Bug Status: Unconfirmed

Description

Whit the new functionality of text to Speech, we found the following problem.

If a user is using Write, select a text and press Alt-Shift-S, the text is played, and no object is added to the clipboard. If the user copy a object, and later press Alt-Shift-S, a new object is added to the clipboard.

This is probably, because Write is using gtk_clipboard_set_with_owner(). See http://developer.gnome.org/gtk/2.24/gtk-Clipboards.html

When you set the contents of the clipboard, you can either supply the data directly (via functions like gtk_clipboard_set_text()), or you can supply a callback to be called at a later time when the data is needed (via gtk_clipboard_set_with_data() or gtk_clipboard_set_with_owner().) Providing a callback also avoids having to make copies of the data when it is not needed.

I propose doing a hash of the selected data, and use it to check if the data is already included in our clipboard_objects list.

This have another consequence, if you select a text and press many times "Ctrl-C", is only added one time. I think this is ok, but I don't know if there are one use case I am not thinking.

One last issue: If we copy text "A", later text "B", and later text "A" again, probably we should move "A" to the first place in the selection queue to allow to paste "A" and not "B".

Attachments (1)

0001-Only-add-one-time-every-object-in-the-clipboard.patch (2.5 KB) - added by godiard 12 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 12 years ago by godiard

  • Owner set to godiard
  • Status changed from new to assigned

comment:2 Changed 12 years ago by godiard

  • Cc garycmartin added

Need implement setting the clipboard with the last copied object.

Gary, any comment?

comment:3 Changed 12 years ago by godiard

  • Keywords 12.1.0 added

comment:4 Changed 12 years ago by godiard

  • Summary changed from Press ALt-Shift-S to do TTS in Write after copy a text duplicate the copied text in the clipboard to Bad interaction between Clipboard and TTS

Selecting the already existing object in the clipboard, and display notification is implemented in the last version of the patch
http://lists.sugarlabs.org/archive/sugar-devel/2012-April/036757.html

Now, if the selected to copy text is already copied in the clipboard, we don't add the new text as another icon in the try, but only select the already added icon.

Note the order in the icons is not changed, only the icon activated (is a radio button)

comment:5 Changed 12 years ago by godiard

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:6 Changed 11 years ago by dnarvaez

  • Milestone 0.96 deleted

Milestone 0.96 deleted

Note: See TracTickets for help on using tickets.