[Bugs] #4418 sugar UNSP: Can't copy images to clipboard

Sugar Labs Bugs bugtracker-noreply at sugarlabs.org
Wed Feb 13 08:02:21 EST 2013


#4418: Can't copy images to clipboard
------------------------------------------+---------------------------------
    Reporter:  dsd                        |          Owner:  erikos     
        Type:  defect                     |         Status:  new        
    Priority:  Unspecified by Maintainer  |      Milestone:  0.98       
   Component:  sugar                      |        Version:  Unspecified
    Severity:  Unspecified                |       Keywords:             
Distribution:  Unspecified                |   Status_field:  Unconfirmed
------------------------------------------+---------------------------------
Changes (by humitos):

 * cc: erikos (added)


Comment:

 Replying to [comment:2 erikos]:
 > - does it happen on other XO hardware

 I tested this in XO 1.5 os27 and it did not happen; anyway, after the icon
 appears in the frame and I click on 'open', it's opened with Paint but
 there is no image at all: blank canvas.

 The difference that I noticed is the order of the file types to check:

  * XO-4:
    * TIMESTAMP
    * [...]
    * image/png
    * image/bmp
    * [...]
    * image/jpeg
    * image/x-win-bitmap

 and there the message {{{no data for selection target image/x-win-
 bitmap}}} appears in the shell.log and the variable {{{selection}}} is
 pointing to {{{None}}}.

  * XO-1.5:
    * TIMESTAMP
    * [...]
    * image/png
    * image/bmp
    * [...]
    * image/x-win-bitmap
    * image/jpeg

 here the {{{selection}}} variable is assigned to something significant
 because there is selection target for image/jpeg.

 So, I use {{{cb_selections[-1]}}} to get the last significant value. Here
 is the diff:

 {{{
 diff --git a/src/jarabe/frame/clipboardpanelwindow.py
 b/src/jarabe/frame/clipboardpanelwindow.py
 index ba86775..79cfb7e 100644
 --- a/src/jarabe/frame/clipboardpanelwindow.py
 +++ b/src/jarabe/frame/clipboardpanelwindow.py
 @@ -78,6 +78,7 @@ class ClipboardPanelWindow(FrameWindow):
                      continue
                  cb_selections.append(selection)

 +        selection = cb_selections[-1]
          if target_is_uri:
              uri = selection.get_data()
              filename = uri[len('file://'):].strip()
 }}}

 This diff solves the traceback but I see a blank canvas when I open it
 with Paint, like in XO-1.5.

 NOTE: on XO-4 (with this patch applied) and on XO-1.5, if I right-click on
 the clipboard icon, then click in 'Keep' and finally open the image from
 the Journal, it opens with ImageViewer and I see the image.

-- 
Ticket URL: <http://bugs.sugarlabs.org/ticket/4418#comment:3>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system


More information about the Bugs mailing list