Skip to content

Support for file dropping#3615

Open
JonnyPtn wants to merge 3 commits intoSFML:masterfrom
JonnyPtn:filedrop
Open

Support for file dropping#3615
JonnyPtn wants to merge 3 commits intoSFML:masterfrom
JonnyPtn:filedrop

Conversation

@JonnyPtn
Copy link
Contributor

@JonnyPtn JonnyPtn commented Nov 26, 2025

Rebased #2265 on latest master and addressed only outstanding review point I could see (removing some commented out code that I assume was left from earlier testing)

Updated the event handling example to be able to test this event

Have tested on mac and windows, but don't have access to a linux machine with a GUI

closes #3565

Tasks

  • Tested on Linux
  • Tested on Windows
  • Tested on macOS

How to test this PR?

Run the event handling example and drop some files into the window - the file path(s) will be shown in the log

@eXpl0it3r eXpl0it3r added this to the 3.2 milestone Nov 26, 2025
@github-project-automation github-project-automation bot moved this to Planned in SFML 3.2.0 Nov 26, 2025
@eXpl0it3r eXpl0it3r moved this from Planned to In Review in SFML 3.2.0 Nov 26, 2025
////////////////////////////////////////////////////////////
struct FilesDropped
{
std::vector<String> filenames; //!< Files which were dropped
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why isn't it a std filesystem path?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably just because this was originally targeting SFML 2

@Zombieschannel
Copy link
Contributor

Tested on Ubuntu 25.10 on Wayland, seems to work fine but it also seems like it shouldn't work as I'm getting an error saying it is not supported on XWayland...
Not sure what is going on here...

image

Other than that I think this is a great feature though I'm curious why is this planned for SFML 3.2 and not 3.1?

@eXpl0it3r
Copy link
Member

Other than that I think this is a great feature though I'm curious why is this planned for SFML 3.2 and not 3.1?

I'd like to release 3.1 soon and event/input/window improvements will be the primary focus of SFML 3.2.

@JonnyPtn
Copy link
Contributor Author

JonnyPtn commented Feb 2, 2026

I've rebased onto latest master and removed the xwayland check - I guess it was working without the x11 window atom being set, but comments indicate it may crash, so curious if you can test that. If it does still crash then I can add the check again but without the error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Add Support for Drag & Drop Events

5 participants