Fix drop state update on move incorrect when transitioning between windows

This commit is contained in:
Kovid Goyal 2026-05-17 07:50:41 +05:30
parent 0fc73dd8c3
commit 75b99a3cbf
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 2 additions and 6 deletions

2
glfw/wl_window.c vendored
View file

@ -2510,7 +2510,7 @@ 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, size_t accepted_count) {
update_drop_state(_GLFWWaylandDataOffer *d, _GLFWwindow* window, const size_t accepted_count) {
d->copy_mimes_count = accepted_count;
bool accepted = accepted_count > 0;
bool acceptance_changed = (accepted != d->drag_accepted);

View file

@ -810,10 +810,6 @@ drop_dest_callback(GLFWwindow *window, GLFWDropEvent *ev) {
is_client_drop = !is_kitty_ui_drag && wid && w && w->drop.wanted;
global_state.drop_dest.allowed_ops = ev->operation.source_actions;
if (is_client_drop) {
if (!w->drop.initialized) {
w->drop.initialized = true;
w->drop.accepted_operation = GLFW_DRAG_OPERATION_NONE;
}
drop_move_on_child(w, ev->mimes, ev->num_mimes, false);
ev->num_mimes = drop_update_mimes(w, ev->mimes, ev->num_mimes);
ev->operation.allowed = w->drop.accepted_operation;

View file

@ -290,7 +290,7 @@ typedef struct Window {
bool is_hovering;
} scrollbar;
struct {
bool wanted, hovered, dropped, is_remote_client, initialized;
bool wanted, hovered, dropped, is_remote_client;
uint32_t client_id;
char *registered_mimes;
char *uri_list; size_t uri_list_sz;