mirror of
https://github.com/mpv-player/mpv
synced 2025-03-11 08:37:59 +00:00
command: add begin-vo-dragging command
This command initializes a vo dragging request for VOs that implement the new VOCTRL_BEGIN_DRAGGING voctrl. This allows scripts to begin vo dragging for any button press event.
This commit is contained in:
parent
4560d93bf0
commit
9d03b83a6c
@ -27,6 +27,7 @@ Interface changes
|
||||
::
|
||||
|
||||
--- mpv 0.38.0 ---
|
||||
- add `begin-vo-dragging` command
|
||||
- add `--volume-gain`, `--volume-gain-min`, and `--volume-gain-max` options
|
||||
- add `current-gpu-context` property
|
||||
- add `--secondary-sub-ass-override` option
|
||||
|
@ -1478,6 +1478,13 @@ Input Commands that are Possibly Subject to Change
|
||||
This command has an even more uncertain future than ``ab-loop-dump-cache``
|
||||
and might disappear without replacement if the author decides it's useless.
|
||||
|
||||
``begin-vo-dragging``
|
||||
Begin window dragging if supported by the current VO. This command should
|
||||
only be called while a mouse button is being pressed, otherwise it will
|
||||
be ignored. The exact effect of this command depends on the VO implementation
|
||||
of window dragging. For example, on Windows only the left mouse button can
|
||||
begin window dragging, while X11 and Wayland allow other mouse buttons.
|
||||
|
||||
Undocumented commands: ``ao-reload`` (experimental/internal).
|
||||
|
||||
List of events
|
||||
|
@ -6502,6 +6502,16 @@ static void cmd_dump_cache_ab(void *p)
|
||||
cmd->args[0].v.s);
|
||||
}
|
||||
|
||||
static void cmd_begin_vo_dragging(void *p)
|
||||
{
|
||||
struct mp_cmd_ctx *cmd = p;
|
||||
struct MPContext *mpctx = cmd->mpctx;
|
||||
struct vo *vo = mpctx->video_out;
|
||||
|
||||
if (vo)
|
||||
vo_control(vo, VOCTRL_BEGIN_DRAGGING, NULL);
|
||||
}
|
||||
|
||||
/* This array defines all known commands.
|
||||
* The first field the command name used in libmpv and input.conf.
|
||||
* The second field is the handler function (see mp_cmd_def.handler and
|
||||
@ -6970,6 +6980,8 @@ const struct mp_cmd_def mp_cmds[] = {
|
||||
|
||||
{ "ab-loop-align-cache", cmd_align_cache_ab },
|
||||
|
||||
{ "begin-vo-dragging", cmd_begin_vo_dragging },
|
||||
|
||||
{0}
|
||||
};
|
||||
|
||||
|
@ -122,6 +122,9 @@ enum mp_voctrl {
|
||||
|
||||
/* private to vo_gpu and vo_gpu_next */
|
||||
VOCTRL_EXTERNAL_RESIZE,
|
||||
|
||||
// Begin VO dragging.
|
||||
VOCTRL_BEGIN_DRAGGING,
|
||||
};
|
||||
|
||||
// Helper to expose what kind of content is currently playing to the VO.
|
||||
|
Loading…
Reference in New Issue
Block a user