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

EventHandler::files_dropped_event not usable due to Window not allowing dropping files #423

Open
Nrosa01 opened this issue Apr 10, 2024 · 3 comments

Comments

@Nrosa01
Copy link

Nrosa01 commented Apr 10, 2024

I trying out miniquad to see if I could port the EventHandler::files_dropped_event to macroquad but it seems it won't work even in miniquad. By reading the codet the event seems to be correctly managed, so it should be possible to use it:

src/lib.rs

189    pub fn dropped_file_count() -> usize {
190        let d = native_display().lock().unwrap();
191        d.dropped_files.bytes.len()
192    }
193    pub fn dropped_file_bytes(index: usize) -> Option<Vec<u8>> {
194        let d = native_display().lock().unwrap();
195        d.dropped_files.bytes.get(index).cloned()
196    }
197    pub fn dropped_file_path(index: usize) -> Option<std::path::PathBuf> {
198        let d = native_display().lock().unwrap();
199        d.dropped_files.paths.get(index).cloned()
200    }

Now, the important, when you try to drop something to a miniquad windows:

image

You can see the windows block cursor icon that appears when I drag a file from the explorer onto the windows. Even if miniquad functions are completed an able to work, the Windows itself won't allow it.

I wanted to contribute to help fix this as it's a feature important for my project. I've been reading miniquad codebase for a while but I don't get why this happens.

I'll continue reading the code and trying to make this work cross-platform. There are some similar issues so there might be more people affected by this, but those issues are old and doesn't explain if the function itself wasn't working or if it was the same problem exposed here.

@not-fl3
Copy link
Owner

not-fl3 commented Apr 11, 2024

related PR that I believe was not fully migrated to miniquad-0.4 #275

@Nrosa01
Copy link
Author

Nrosa01 commented Apr 11, 2024

Oh I didn't see that PR.Thank you! I'll try to migrate it to miniquad 0.4

@Nrosa01
Copy link
Author

Nrosa01 commented Apr 11, 2024

I found out this works on wasm, it seems to fail on Windows. Sadly I don't have a Linux machine to test, I'll install vmware player once I get this working on windows and check if it works on Linux

Edit: It works only on egui-miniquad, I used the same code on miniquad and it didn't work. Which is weird, I was using miniquad 0.4.0 and egui-miniquad was also using 0.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants