Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#3819 closed defect (fixed)

Clipboard drag&drop: error when dragging an icon to the clipboard

Reported by: erikos Owned by: erikos
Priority: Normal Milestone:
Component: Sugar Version: 0.97.x
Severity: Major Keywords: regression, olpc-test-pending
Cc: manuq Distribution/OS: OLPC
Bug Status: Assigned

Description

Steps to reproduce (you need to apply #3811 and #3818 first):

  • open the Browse activity
  • drag an image to the clipboard

---> the notification pulsing icon should be of the same type as the clipboard icon

1345538574.421700 DEBUG root: ClipboardTray: adding type 'text/uri-list'
1345538574.421790 DEBUG root: Clipboard.add_object_format
Traceback (most recent call last):
  File "/home/erikos/sugar-build/install/lib/python2.7/site-packages/jarabe/frame/clipboardtray.py", line 210, in drag_data_received_cb
    self._add_selection(object_id, selection)
  File "/home/erikos/sugar-build/install/lib/python2.7/site-packages/jarabe/frame/clipboardtray.py", line 96, in _add_selection
    on_disk=True)
  File "/home/erikos/sugar-build/install/lib/python2.7/site-packages/jarabe/frame/clipboard.py", line 92, in add_object_format
    new_uri = self._copy_file(data)
  File "/home/erikos/sugar-build/install/lib/python2.7/site-packages/jarabe/frame/clipboard.py", line 166, in _copy_file
    f_, new_file_path = tempfile.mkstemp(ext, root)
  File "/usr/lib/python2.7/tempfile.py", line 300, in mkstemp
    return _mkstemp_inner(dir, prefix, suffix, flags)
  File "/usr/lib/python2.7/tempfile.py", line 235, in _mkstemp_inner
    fd = _os.open(file, flags, 0600)
TypeError: must be encoded string without NULL bytes, not str
1345538574.424115 DEBUG root: ClipboardTray: got data for target '_NETSCAPE_URL'
1345538574.424240 DEBUG root: ClipboardTray: adding type '_NETSCAPE_URL'
1345538574.424326 DEBUG root: Clipboard.add_object_format

Attachments (4)

frame_dnd_3819.patch (3.8 KB) - added by manuq 8 years ago.
API fixes, unfinished patch, still some work to do
0001-Bring-back-drag-and-drop-to-the-frame-clipboard-SL-3.patch (9.5 KB) - added by manuq 8 years ago.
Patch. Still one thing pending, see FIXME.
0001-Bring-back-dragging-of-elements-from-the-activities-.patch (7.5 KB) - added by manuq 8 years ago.
0001-Bring-back-dragging-of-elements-from-the-activities-.2.patch (10.1 KB) - added by manuq 8 years ago.
Update: use get_uris() instead of splitting get_data()

Download all attachments as: .zip

Change History (12)

comment:1 Changed 9 years ago by manuq

This seems to be an issue in WebKitGTK+, as the last guessed MIME in the repeated calls to the toolkit mime.choose_most_significant(mime_types) is "text/html".

comment:2 Changed 9 years ago by manuq

  • Cc manuq added

comment:3 Changed 8 years ago by godiard

  • Keywords regression added
  • Priority changed from Unspecified by Maintainer to Normal

I think this is related to #3903 and is a regression too.

comment:4 Changed 8 years ago by godiard

With the rpms needed to solve #4307, we get the following error:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/jarabe/frame/clipboardtray.py", line 134, in drag_motion_cb
    if self._internal_drag(context):
  File "/usr/lib/python2.7/site-packages/jarabe/frame/clipboardtray.py", line 187, in _internal_drag
    source_widget = context.get_source_widget()
AttributeError: 'gtk.gdk.X11DragContext' object has no attribute 'get_source_widget'

Changed 8 years ago by manuq

API fixes, unfinished patch, still some work to do

Changed 8 years ago by manuq

Patch. Still one thing pending, see FIXME.

comment:5 Changed 8 years ago by manuq

I still need to research why the data comes with a 'x00' character at the end. Could be upstream bug, or an encoding issue.

Changed 8 years ago by manuq

Update: use get_uris() instead of splitting get_data()

comment:6 Changed 8 years ago by manuq

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

Pushed to github master as 0aca8e59 after Daniel Narvaez review.

comment:7 Changed 8 years ago by manuq

  • Keywords olpc-test-pending added

comment:8 Changed 8 years ago by dnarvaez

  • Milestone 0.98 deleted

Milestone 0.98 deleted

Note: See TracTickets for help on using tickets.