xpra icon
Bug tracker and wiki

Opened 8 months ago

Closed 6 months ago

Last modified 4 weeks ago

#1493 closed enhancement (fixed)

initial network drag and drop

Reported by: Antoine Martin Owned by: J. Max Mena
Priority: major Milestone: 2.1
Component: client Version: trunk
Keywords: Cc:

Description

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 (6)

comment:1 Changed 8 months 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

comment:2 Changed 6 months ago by J. Max Mena

Before I close this:

Is this meant to work with applications? As in, if I drag an image locally and send it remotely into a word processor, will the image show up? Same thing for uploading a photo to...somewhere.

comment:3 in reply to:  2 Changed 6 months ago by Antoine Martin

Owner: changed from alas to J. Max Mena

Is this meant to work with applications? As in, if I drag an image locally and send it remotely into a word processor, will the image show up? Same thing for uploading a photo to...somewhere.

No. To handle drag and drop interactively with the remote application, you want #1494.

What this allows you to do is to drop files onto an xpra window and have them uploaded and opened with the default system application for this type of file type - the application window you drop it onto is not used for anything.

comment:4 Changed 6 months ago by J. Max Mena

Okay, then noted. (seems to do exactly that) Closing.

comment:5 Changed 6 months ago by J. Max Mena

Resolution: fixed
Status: newclosed

(okay actually doing the close)

comment:6 Changed 4 weeks ago by Antoine Martin

Wiki page: drag and drop

Note: See TracTickets for help on using tickets.