We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2946 - Extensible Drag and Drop API
Summary: Extensible Drag and Drop API
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.1
Hardware: All All
: P2 enhancement
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-16 09:34 UTC by x414e54
Modified: 2017-08-13 00:44 UTC (History)
0 users

See Also:


Attachments
Drag and Drop API extensions. (14.76 KB, patch)
2015-04-16 09:34 UTC, x414e54
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description x414e54 2015-04-16 09:34:16 UTC
Created attachment 2126 [details]
Drag and Drop API extensions.

Currently SDL only supports dropping of files and clipboards of text.

Some GUI applications may want to drag and drop other types of data and even internal content such as widgets or tabs. They may also wish to deal with the file lists directly rather than receiving individual SDL_DropFile events. Furthermore some toolkits may want to accept/decline or animate the data based on the location of the drop event so would need window id and co-ordinates.

Mime types are the most extensible format for arbitrary data and can easily be converted from/to platform specific drag and drop data types.

Currently there are some toolkits which try to implement tab dragging by first spawning a window and then having the window follow the pointer. Adding in an extensible drag and drop api would allow applications to send tabs via an "application/x-appname-tab" mime type. For systems that do not support such a generic drag and drop types SDL could resort to emulating this by spawning a window and having it following the mouse. This means SDL does not have to expose certain mouse/window features that may not be supported on all platforms, including virtual desktop ids or global events.

I have implemented a preliminary API interface to allow drag and dropping any kind of data and then allowing the application to receive some events. Currently the accept/decline will works similar to the hit test callback and the initial drag, but this could be changed.

I would appreciate anyones opinions on the API and if there are any alternative implementations. I will look next to implementing the actual backend on different platforms.
Comment 1 Sam Lantinga 2017-08-13 00:44:20 UTC
Interesting proposal! I'm marking it for consideration for SDL 2.1.