Simplify new drag/drop API

Fixes #9466
This commit is contained in:
copilot-swe-agent[bot]
2026-02-03 15:24:44 +00:00
committed by Kovid Goyal
parent c0bb8ae2a0
commit fac4420804
13 changed files with 365 additions and 154 deletions

11
glfw/input.c vendored
View File

@@ -403,16 +403,15 @@ void _glfwInputCursorEnter(_GLFWwindow* window, bool entered)
// Notifies shared code of files or directories dropped on a window
//
int _glfwInputDrop(_GLFWwindow* window, const char *mime, const char *text, size_t sz)
void _glfwInputDrop(_GLFWwindow* window, const char *mime, const char *text, size_t sz)
{
if (window->callbacks.drop)
return window->callbacks.drop((GLFWwindow*) window, mime, text, sz);
return 0;
window->callbacks.drop((GLFWwindow*) window, mime, text, sz);
}
// Notifies shared code of a drag event
//
int _glfwInputDragEvent(_GLFWwindow* window, int event, double xpos, double ypos, const char** mime_types, int mime_count)
int _glfwInputDragEvent(_GLFWwindow* window, int event, double xpos, double ypos, const char** mime_types, int* mime_count)
{
if (window->callbacks.drag)
return window->callbacks.drag((GLFWwindow*) window, event, xpos, ypos, mime_types, mime_count);
@@ -1141,13 +1140,13 @@ GLFWAPI int glfwStartDrag(GLFWwindow* handle, const GLFWdragitem* items, int ite
return _glfwPlatformStartDrag(window, items, item_count, thumbnail, operation);
}
GLFWAPI void glfwSetDragAcceptance(GLFWwindow* handle, bool accepted)
GLFWAPI void glfwUpdateDragState(GLFWwindow* handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
assert(window != NULL);
_GLFW_REQUIRE_INIT();
_glfwPlatformSetDragAcceptance(window, accepted);
_glfwPlatformUpdateDragState(window);
}
GLFWAPI int glfwJoystickPresent(int jid)