Linux: Fix regression that broke drag and drop from GTK applications

Fixes #9656
This commit is contained in:
Kovid Goyal 2026-03-13 20:19:33 +05:30
parent a97f468a02
commit e72f49952d
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 5 additions and 2 deletions

View file

@ -182,6 +182,8 @@ Detailed list of changes
- Wayland: Fix momentum scrolling not working on compositors that send a stop frame with no axis information (:iss:`9653`)
- Linux: Fix regression that broke drag and drop from GTK applications (:iss:`9656`)
0.46.0 [2026-03-11]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2
glfw/wl_window.c vendored
View file

@ -2577,7 +2577,7 @@ _glfwPlatformReadAvailableDropData(GLFWwindow *w, GLFWDropEvent *ev, char *buffe
for (size_t o = 0; o < offer->dd_count; o++) {
if (offer->requested_drop_data[o].fd == fd) {
ssize_t ret;
do { ret = read(fd, buffer, sz); } while (ret < 0 && errno == EINTR);
do { ret = read(fd, buffer, sz); } while (ret < 0 && (errno == EINTR || errno == EAGAIN));
if (ret <= 0) removeWatch(&_glfw.wl.eventLoopData, offer->requested_drop_data[o].watch_id);
return ret < 0 ? -errno : ret;
}

View file

@ -729,7 +729,7 @@ update_allowed_mimes_for_drop(GLFWDropEvent *ev) {
}
}
if (prio_arr != priorities) free(prio_arr);
ev->num_mimes = remove_duplicate_mimes(ev->mimes, new_count);
ev->num_mimes = new_count;
}
}
@ -799,6 +799,7 @@ on_drop(GLFWwindow *window, GLFWDropEvent *ev) {
break;
}
update_allowed_mimes_for_drop(ev);
ev->num_mimes = remove_duplicate_mimes(ev->mimes, ev->num_mimes);
global_state.drop_dest.num_left = ev->num_mimes;
if (!global_state.drop_dest.num_left || !(global_state.drop_dest.data = PyDict_New())) {
ev->finish_drop(window, GLFW_DRAG_OPERATION_GENERIC);