mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-28 04:13:44 +00:00
Have mimes_count be always accurate
This commit is contained in:
parent
c19ec465cb
commit
f3cda7e828
2 changed files with 5 additions and 1 deletions
4
glfw/wl_window.c
vendored
4
glfw/wl_window.c
vendored
|
|
@ -2452,6 +2452,10 @@ static void handle_primary_selection_offer(void *data UNUSED, struct zwp_primary
|
|||
// Helper function to update drop state from callback results
|
||||
static void
|
||||
update_drop_state(_GLFWWaylandDataOffer *d, _GLFWwindow* window UNUSED, size_t mime_count) {
|
||||
for (size_t i = mime_count; i < d->mimes_count; i++) {
|
||||
if (d->mimes[i]) { free((void*)d->mimes[i]); d->mimes[i] = NULL; }
|
||||
}
|
||||
d->mimes_count = mime_count;
|
||||
bool accepted = mime_count > 0;
|
||||
bool acceptance_changed = (accepted != d->drag_accepted);
|
||||
// The first MIME in the sorted list is the preferred one for drop
|
||||
|
|
|
|||
|
|
@ -693,7 +693,7 @@ read_drop_data(GLFWwindow *window, GLFWDropEvent *ev) {
|
|||
global_state.drop_dest.num_left--;
|
||||
if (!global_state.drop_dest.num_left) {
|
||||
WINDOW_CALLBACK(on_drop, "OOii", global_state.drop_dest.data, Py_False,
|
||||
global_state.callback_os_window->last_drag_event.x, global_state.callback_os_window->last_drag_event.y);
|
||||
global_state.callback_os_window->last_drag_event.x, global_state.callback_os_window->last_drag_event.y);
|
||||
finish(true);
|
||||
}
|
||||
} else if (ret > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue