mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 16:37:27 +00:00
...
This commit is contained in:
parent
702f9905d2
commit
f8d3d17b40
3 changed files with 11 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue