[Bugs] #3371 UNSP: Press ALt-Shift-S to do TTS in Write after copy a text duplicate the copied text in the clipboard

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Wed Mar 14 17:09:39 EDT 2012


#3371: Press ALt-Shift-S to do TTS in Write after copy a text duplicate the copied
text in the clipboard
------------------------------------------+---------------------------------
    Reporter:  godiard                    |          Owner:             
        Type:  defect                     |         Status:  new        
    Priority:  Unspecified by Maintainer  |      Milestone:  0.96       
   Component:  sugar                      |        Version:  Unspecified
    Severity:  Unspecified                |       Keywords:             
Distribution:  Unspecified                |   Status_field:  Unconfirmed
------------------------------------------+---------------------------------
 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".

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/3371>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list