Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win32: fix the issue of menu click failure caused by excessive menu-data updates #15701

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion video/out/win32/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ static int append_menu(HMENU hmenu, UINT fMask, UINT fType, UINT fState,
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | fMask;
mii.wID = id++;
// menu id must be less than 0xF000 and greater than WM_USER
if (id >= 0xF000)
id = WM_USER + 100;
kasper93 marked this conversation as resolved.
Show resolved Hide resolved

if (fMask & MIIM_FTYPE)
mii.fType = fType;
Expand Down Expand Up @@ -218,7 +221,7 @@ void mp_win32_menu_show(struct menu_ctx *ctx, HWND hwnd)
void mp_win32_menu_update(struct menu_ctx *ctx, struct mpv_node *data)
{
while (GetMenuItemCount(ctx->menu) > 0)
RemoveMenu(ctx->menu, 0, MF_BYPOSITION);
DeleteMenu(ctx->menu, 0, MF_BYPOSITION);
talloc_free_children(ctx->ta_data);

build_menu(ctx->ta_data, ctx->menu, data);
Expand Down
Loading