This commit is contained in:
Kovid Goyal 2026-02-28 16:54:02 +05:30
parent 2d1d340d41
commit 7500c58e1c
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

2
glfw/x11_window.c vendored
View file

@ -1529,7 +1529,7 @@ update_drop_state(_GLFWwindow* window, size_t mime_count) {
// The first MIME in the sorted list is the preferred one for drop
const char* new_preferred_mime = (accepted && mime_count > 0) ? dnd.mimes[0] : NULL;
// Check if the preferred MIME changed
bool mime_changed = (new_preferred_mime == NULL && dnd.format[0] != 0) || strncmp(new_preferred_mime, dnd.format, arraysz(dnd.format)) != 0;
bool mime_changed = strncmp(new_preferred_mime ? new_preferred_mime : "", dnd.format, arraysz(dnd.format)) != 0;
if (mime_changed) {
if (new_preferred_mime) strncpy(dnd.format, new_preferred_mime, arraysz(dnd.format)-1);
else dnd.format[0] = 0;