diff --git a/src/menu.c b/src/menu.c index 4da4743..5da62b2 100644 --- a/src/menu.c +++ b/src/menu.c @@ -158,12 +158,10 @@ void show_menu(plugin_ctx *ctx, POINT *pt) { if (!PtInRect(&rc, *pt)) return; ClientToScreen(ctx->hwnd, pt); - mpv_command(ctx->mpv, - (const char *[]){"script-message", "menu-open", NULL}); + mp_command_async("script-message menu-open"); TrackPopupMenuEx(ctx->hmenu, TPM_LEFTALIGN | TPM_LEFTBUTTON, pt->x, pt->y, ctx->hwnd, NULL); - mpv_command(ctx->mpv, - (const char *[]){"script-message", "menu-close", NULL}); + mp_command_async("script-message menu-close"); } // run mpv command stored in menu item data diff --git a/src/plugin.c b/src/plugin.c index 06a31c0..348f329 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -212,7 +212,7 @@ static void async_cmd_fn(void *data) { mpv_command_string(ctx->mpv, (const char *)data); } -// run command on none-ui thread +// run command in none-ui thread void mp_command_async(const char *args) { mp_dispatch_enqueue(ctx->dispatch, async_cmd_fn, (void *)args); mpv_wakeup(ctx->mpv);