diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 74387cda8..3c4c7b8fc 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -4194,6 +4194,9 @@ _glfwPlatformStartDrag(_GLFWwindow* window, const GLFWimage* thumbnail) {@autore void _glfwPlatformFreeDragSourceData(void) { } +int +_glfwPlatformChangeDragImage(const GLFWimage *thumbnail) { (void)thumbnail; return 0; /* TODO: Implement me */ } + int _glfwPlatformDragDataReady(const char *mime_type) { if (!file_promise_providers) return 0; diff --git a/glfw/glfw3.h b/glfw/glfw3.h index e152d468a..997133454 100644 --- a/glfw/glfw3.h +++ b/glfw/glfw3.h @@ -4982,7 +4982,8 @@ GLFWAPI void glfwEndDrop(GLFWwindow *window, GLFWDragOperationType op); GLFWAPI GLFWdragsourcefun glfwSetDragSourceCallback(GLFWwindow* window, GLFWdragsourcefun callback); // Start a drag. If called with operations == -1 indicates that previously -// requested data via GLFW_DRAG_DATA_REQUEST is ready. +// requested data via GLFW_DRAG_DATA_REQUEST is ready. operations == -2 means +// that the drag image is changed. GLFWAPI int glfwStartDrag(GLFWwindow* window, const GLFWDragSourceItem *items, size_t mime_count, const GLFWimage* thumbnail, int operations); /*! @brief Returns whether the specified joystick is present. diff --git a/glfw/input.c b/glfw/input.c index 0fa150392..0518a39dc 100644 --- a/glfw/input.c +++ b/glfw/input.c @@ -1166,6 +1166,7 @@ glfwStartDrag(GLFWwindow* handle, const GLFWDragSourceItem *items, size_t item_c assert(window != NULL); _GLFW_REQUIRE_INIT_OR_RETURN(EINVAL); if (operations == -1) return _glfwPlatformDragDataReady(items[0].mime_type); + if (operations == -2) return _glfwPlatformChangeDragImage(thumbnail); _glfwFreeDragSourceData(); _glfw.drag.instance_id++; if (!items || !item_count) return 0; diff --git a/glfw/internal.h b/glfw/internal.h index b2ed61b28..d7e58e50a 100644 --- a/glfw/internal.h +++ b/glfw/internal.h @@ -837,6 +837,7 @@ void _glfwFreeDragSourceData(void); void _glfwPlatformFreeDragSourceData(void); void _glfwInputDragSourceRequest(_GLFWwindow* window, GLFWDragEvent *ev); int _glfwPlatformDragDataReady(const char *mime_type); +int _glfwPlatformChangeDragImage(const GLFWimage *thumbnail); void _glfwInputColorScheme(GLFWColorScheme, bool); diff --git a/glfw/null_window.c b/glfw/null_window.c index 0c32cd40e..b46279c9d 100644 --- a/glfw/null_window.c +++ b/glfw/null_window.c @@ -542,6 +542,7 @@ _glfwPlatformStartDrag(_GLFWwindow* window, const GLFWimage* thumbnail) { } void _glfwPlatformFreeDragSourceData(void) {} int _glfwPlatformDragDataReady(const char *mime_type) { (void) mime_type; return 0; } +int _glfwPlatformChangeDragImage(const GLFWimage *thumbnail) { (void)thumbnail; return 0; } const char** _glfwPlatformGetDropMimeTypes(GLFWDropData* drop UNUSED, int* count) { diff --git a/glfw/wl_window.c b/glfw/wl_window.c index e4f4bde7a..b8b08be8a 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -3189,6 +3189,9 @@ add_drag_watch(int fd) { &_glfw.wl.eventLoopData, "drag_source", fd, POLLOUT | POLLERR | POLLHUP, true, ready_for_drag_data, NULL); } +int +_glfwPlatformChangeDragImage(const GLFWimage *thumbnail) { (void)thumbnail; return 0; /* TODO: Implement me */ } + int _glfwPlatformDragDataReady(const char *mime_type) { for (size_t i = 0; i < _glfw.wl.drag.count; i++) { diff --git a/glfw/x11_window.c b/glfw/x11_window.c index b3bb6c566..62985bee5 100644 --- a/glfw/x11_window.c +++ b/glfw/x11_window.c @@ -4474,6 +4474,9 @@ _glfwPlatformFreeDragSourceData(void) { _glfw.x11.drag.pending_capacity = 0; } +int +_glfwPlatformChangeDragImage(const GLFWimage *thumbnail) { (void)thumbnail; return 0; /* TODO: Implement me */ } + int _glfwPlatformDragDataReady(const char *mime_type) { // Find the pending request for this MIME type