mirror of
https://github.com/encounter/SDL.git
synced 2025-12-21 10:49:12 +00:00
Added SDL_DROPBEGIN and SDL_DROPCOMPLETE events, plus window IDs for drops.
This allows an app to know when a set of drops are coming in a grouping of some sort (for example, a user selected multiple files and dropped them all on the window with a single drag), and when that set is complete. This also adds a window ID to the drop events, so the app can determine to which window a given drop was delivered. For application-level drops (for example, you launched an app by dropping a file on its icon), the window ID will be zero.
This commit is contained in:
@@ -907,12 +907,13 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
if (buffer) {
|
||||
if (DragQueryFile(drop, i, buffer, size)) {
|
||||
char *file = WIN_StringToUTF8(buffer);
|
||||
SDL_SendDropFile(file);
|
||||
SDL_SendDropFile(data->window, file);
|
||||
SDL_free(file);
|
||||
}
|
||||
SDL_stack_free(buffer);
|
||||
}
|
||||
}
|
||||
SDL_SendDropComplete(data->window);
|
||||
DragFinish(drop);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user