Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensible Drag and Drop API #1829

Open
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Open

Extensible Drag and Drop API #1829

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.1
Reported for operating system, platform: All, All

Comments on the original bug report:

On 2015-04-16 09:34:16 +0000, wrote:

Created attachment 2126
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.

On 2017-08-13 00:44:20 +0000, Sam Lantinga wrote:

Interesting proposal! I'm marking it for consideration for SDL 2.1.

@SDLBugzilla SDLBugzilla added the enhancement New feature or request label Feb 10, 2021
@icculus icculus added this to the 3.0 milestone Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants