This commit is contained in:
Kovid Goyal 2026-04-08 19:31:40 +05:30
parent 702f9905d2
commit f8d3d17b40
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 11 additions and 0 deletions

View file

@ -1101,6 +1101,8 @@ drag_get_data(Window *w, const char *mime_type, size_t *sz, int *err_code) {
void
drag_process_item_data(Window *w, size_t idx, int has_more, const uint8_t *payload, size_t payload_sz) {
(void)w; (void)idx; (void)has_more; (void)payload; (void)payload_sz;
// call notify_drag_data_ready() after writing payload to file and
// dont forget to check the return value of notify_drag_data_ready()
}
#undef img
#undef abrt

View file

@ -1144,6 +1144,14 @@ drag_source_callback(GLFWwindow *window UNUSED, GLFWDragEvent *ev) {
}
#undef ds
int
notify_drag_data_ready(id_type os_window_id, const char *mime_type) {
OSWindow *w = os_window_for_id(os_window_id);
GLFWDragSourceItem item = {.mime_type = mime_type};
if (w && w->handle) return glfwStartDrag(w->handle, &item, 1, NULL, -1, false);
return ENOENT;
}
static char*
get_current_selection(void) {
if (!global_state.boss) return NULL;

View file

@ -598,3 +598,4 @@ void request_drop_data(OSWindow *w, id_type wid, const char* mime);
void cancel_current_drag_source(void);
bool change_drag_image(int idx);
int start_window_drag(Window *w);
int notify_drag_data_ready(id_type os_window_id, const char *mime_type);