Skip to content

context_menu.lua: set user-data/mpv/context-menu/open#17429

Open
guidocella wants to merge 1 commit intompv-player:masterfrom
guidocella:menu-open
Open

context_menu.lua: set user-data/mpv/context-menu/open#17429
guidocella wants to merge 1 commit intompv-player:masterfrom
guidocella:menu-open

Conversation

@guidocella
Copy link
Contributor

Closes #17428.

Questions:

  • Should be context-menu or context_menu?
  • Should this instead be a top-level property that also shows the Windows menu status?
  • Or should the Windows menu also update user-data?

@dyphire
Copy link
Contributor

dyphire commented Feb 19, 2026

The Windows menu does not need to update user-data, it is located at the top level of the window and is not affected by OSC. It can be displayed together with various OSC and OSD menus.

@guidocella
Copy link
Contributor Author

The main use case would be for pausing when the context menu is open (#16816 (comment))

(context_menu.lua also renders just fine with osc.lua or ModernZ so I guess it's a uosc problem?)

@dyphire
Copy link
Contributor

dyphire commented Feb 19, 2026

The main use case would be for pausing when the context menu is open (#16816 (comment))

(context_menu.lua also renders just fine with osc.lua or ModernZ so I guess it's a uosc problem?)

Yes, I found this problem while using uosc.

@Keith94
Copy link

Keith94 commented Feb 22, 2026

Or should the Windows menu also update user-data?

Does that mean it can be supported with native Windows menu? If so that would be nice.

The feature is working with an autoprofile. If I had one nitpick, the first menu entry still reads "Pause" at the same time pause is activated. Maybe it should say "Play/Pause" instead?

[context-menu-pause]
profile-cond=p['user-data/mpv/context-menu/open']
profile-restore=copy
pause

@guidocella
Copy link
Contributor Author

The Windows code can easily set and unset a property, the question is how the API should be and whether it needs to be different for the Windows menu and the script.

You can change the first item to Play/Pause in your menu.conf.

Copy link
Member

@kasper93 kasper93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a property of the menu's open state in context_menu.lua

4 participants