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:
Ryan C. Gordon
2016-01-05 01:42:00 -05:00
parent f2defe5e11
commit 8e855f2fbc
9 changed files with 79 additions and 20 deletions

View File

@@ -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;
}