input/dnd: read initial enabled state of input-builtin-drag-and-drop

drag and drop is enabled by default in the options, but disabled in the
dnd handling in code before the initial property change event was
dispatched. leading to ignored dropped-files events when dispatched too
early.

Fixes #17921
This commit is contained in:
der richter
2026-09-12 21:45:57 +02:00
parent 35af06172b
commit caf9cb2df2
+4
View File
@@ -114,6 +114,10 @@ static MP_THREAD_VOID mpv_event_loop_fn(void *arg)
mpv_observe_property(mpv, 0, "dropped-files", MPV_FORMAT_NODE);
mpv_observe_property(mpv, 0, "input-builtin-drag-and-drop", MPV_FORMAT_FLAG);
int enabled_flag;
if (mpv_get_property(mpv, "input-builtin-drag-and-drop", MPV_FORMAT_FLAG, &enabled_flag) == MPV_ERROR_SUCCESS)
enabled = enabled_flag;
while (1) {
mpv_event *event = mpv_wait_event(mpv, -1);
if (event->event_id == MPV_EVENT_SHUTDOWN)