Fix compiler warnings

This commit is contained in:
Kovid Goyal 2026-04-08 19:43:58 +05:30
parent 78dfc1f940
commit 85b13ce941
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 3 deletions

View file

@ -1065,14 +1065,14 @@ drag_notify(Window *w, DragNotifyType type) {
if (strcmp(ds.items[i].mime_type, global_state.drag_source.accepted_mime_type) == 0) {
sz += snprintf(buf + sz, sizeof(buf) - sz, "y=%zu", i); break;
}
}
} break;
case DRAG_NOTIFY_ACTION_CHANGED:
switch (global_state.drag_source.action) {
case GLFW_DRAG_OPERATION_MOVE:
sz += snprintf(buf + sz, sizeof(buf) - sz, "o=2"); break;
default:
sz += snprintf(buf + sz, sizeof(buf) - sz, "o=1"); break;
}
} break;
case DRAG_NOTIFY_DROPPED: break;
case DRAG_NOTIFY_FINISHED:
sz += snprintf(buf + sz, sizeof(buf) - sz, "y=%d", global_state.drag_source.was_canceled ? 1 : 0); break;

View file

@ -1115,8 +1115,9 @@ drag_source_callback(GLFWwindow *window UNUSED, GLFWDragEvent *ev) {
if (is_client_drag) drag_notify(w, DRAG_NOTIFY_ACCEPTED);
break;
case GLFW_DRAG_ACTION_CHANGED:
ds.action = ev->action; break;
ds.action = ev->action;
if (is_client_drag) drag_notify(w, DRAG_NOTIFY_ACTION_CHANGED);
break;
case GLFW_DRAG_DROPPED:
ds.was_dropped = true;
// On Wayland, we cant trust the value of ev->action as it is zero