xpra icon
Bug tracker and wiki

Opened 7 weeks ago

Last modified 7 weeks ago

#1493 new enhancement

initial network drag and drop

Reported by: Antoine Martin Owned by: alas
Priority: major Milestone: 2.1
Component: client Version: trunk
Keywords: Cc:


This is different from intra application drag-n-drop (#770), which was difficult enough to enable.

The html5 client already supports drag and drop of files since r15370.

We should support at least as much in the python client.

Change History (1)

comment:1 Changed 7 weeks ago by Antoine Martin

Owner: changed from Antoine Martin to alas

Done in r15546.

Here's the "-d dragndrop" output from the client as I drop 2 files onto a client window:

drag_motion_cb(ClientWindow(1), <gtk.gdk.DragContext object at 0x7fa3f1f81d70 (GdkDragContext at 0x5632c2d8d1c0)>, 354, 123, 70261214)
drag_drop_cb(ClientWindow(1), <gtk.gdk.DragContext object at 0x7fa3f1f81d70 (GdkDragContext at 0x5632c2d8d1c0)>, 354, 122, 70261240) \
    targets=['x-special/gnome-icon-list', 'text/uri-list', 'UTF8_STRING', 'COMPOUND_TEXT', 'TEXT', 'STRING', 'text/plain;charset=utf-8', 'text/plain']
drag_got_data_cb(ClientWindow(1), <gtk.gdk.DragContext object at 0x7fa3f1f81a50 (GdkDragContext at 0x5632c2d8d1c0)>, 354, 122, <GtkSelectionData at 0x7fff184037e0>, 80, 70261240)
drag_got_data_cb context: source_window=0x3a98d79, dest_window=0x2a00098, suggested_action=<flags GDK_ACTION_COPY of type GdkDragAction>, \
    actions=<flags GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK of type GdkDragAction>, \
    targets=['x-special/gnome-icon-list', 'text/uri-list', 'UTF8_STRING', 'COMPOUND_TEXT', 'TEXT', 'STRING', 'text/plain;charset=utf-8', 'text/plain']
drag_got_data_cb selection: data type=text/uri-list, format=8, length=110, target=text/uri-list, text=None, \
    uris=('file:///home/antoine/Fiber-Internet-201606-201607-2568THB.png', 'file:///home/antoine/thailand-weather-map.png')
drag_got_data_cb: will try to upload: ['/home/antoine/Fiber-Internet-201606-201607-2568THB.png', '/home/antoine/thailand-weather-map.png']
got_file_info(<__main__.GLocalFile at 0x7fa3f1f81e10: file:///home/antoine/Fiber-Internet-201606-201607-2568THB.png>, <__main__.GTask object at 0x7fa3f1f81d70 (GTask at 0x5632c2da7440)>)
file_info(/home/antoine/thailand-weather-map.png)=<gio.FileInfo object at 0x7fa3f1f81f00 (GFileInfo at 0x7fa3d4005210)> ctype=image/png, size=1152655
got_file_info(<__main__.GLocalFile at 0x7fa3f1f81d70: file:///home/antoine/thailand-weather-map.png>, <__main__.GTask object at 0x7fa3f1f81e10 (GTask at 0x5632c2da7100)>)
file_info(/home/antoine/thailand-weather-map.png)=<gio.FileInfo object at 0x7fa3f1f81fa0 (GFileInfo at 0x7fa3d4005800)> ctype=image/png, size=1463040
got_file_data(<__main__.GLocalFile at 0x7fcee4b79910: file:///home/antoine/Fiber-Internet-201606-201607-2568THB.png>, <__main__.GTask object at 0x7fcee4b79780 (GTask at 0x55a26eb0e440)>, ('/home/antoine/thailand-weather-map.png', True)) entity=1491198624:747710
sending file Fiber-Internet-201606-201607-2568THB.png (1152655 bytes)
got_file_data(<__main__.GLocalFile at 0x7fcee4b79910: file:///home/antoine/thailand-weather-map.png>, <__main__.GTask object at 0x7fcee4b799b0 (GTask at 0x55a26eb0e2a0)>, ('/home/antoine/thailand-weather-map.png', True)) entity=1483876226:373767
sending file thailand-weather-map.png (1463040 bytes)

The two files I had dropped immediately showed up in new windows as the server had been started with --open-files=yes.

@afarr: just a FYI, not sure you care about this feature.
Will follow up in #1494

Note: See TracTickets for help on using tickets.