mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-25 02:17:03 +00:00
Propagate error when requesting drop data
This commit is contained in:
parent
35cd3d37f2
commit
ef6539d697
3 changed files with 11 additions and 4 deletions
|
|
@ -668,7 +668,13 @@ do_drop_request_data(Window *w, int32_t idx) {
|
|||
}
|
||||
const char *mime = w->drop.offerred_mimes[idx - 1];
|
||||
w->drop.getting_data_for_mime = strdup(mime);
|
||||
if (w->drop.getting_data_for_mime) request_drop_data(osw, w->id, mime);
|
||||
if (w->drop.getting_data_for_mime) {
|
||||
int err = request_drop_data(osw, w->id, mime);
|
||||
if (err) {
|
||||
drop_send_error(w, err, "drop data request from OS failed");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false; /* async: completion via drop_dispatch_data */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -776,10 +776,11 @@ register_mimes_for_drop(OSWindow *w, const char **mimes, size_t sz) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
request_drop_data(OSWindow *w, id_type wid, const char* mime) {
|
||||
global_state.drop_dest.client_window_data_request = wid;
|
||||
if (w->handle) glfwRequestDropData(w->handle, mime);
|
||||
if (w->handle) return glfwRequestDropData(w->handle, mime);
|
||||
return ENOENT;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -642,7 +642,7 @@ void take_screenshot_of_rectangular_region(OSWindow *os_window, Region region, u
|
|||
bool current_framebuffer_is_ok(void);
|
||||
void request_drop_status_update(OSWindow *osw);
|
||||
void register_mimes_for_drop(OSWindow *w, const char **mimes, size_t sz);
|
||||
void request_drop_data(OSWindow *w, id_type wid, const char* mime);
|
||||
int 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, bool in_test_mode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue