summaryrefslogtreecommitdiffstats
path: root/player/discnav.c
diff options
context:
space:
mode:
authorDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-04-25 18:28:17 +0900
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-04-25 18:28:17 +0900
commit5f1d6b6e5ae515abfb77c78c44d21ee21beb0fc3 (patch)
tree6b757d37d296709dfd5955ef9d4d41426cd47da6 /player/discnav.c
parentd64ff3aa51b49451348383a6ff6de7697a52dc62 (diff)
parent983d24e3b9ce9c9c7755279138c14170e85fbf37 (diff)
downloadmpv-5f1d6b6e5ae515abfb77c78c44d21ee21beb0fc3.tar.bz2
mpv-5f1d6b6e5ae515abfb77c78c44d21ee21beb0fc3.tar.xz
Merge branch 'master' into release/0.9
* master: (87 commits) manpage: move --autosync description player: add --window-scale option player: flush decoder even if cover art is decoded player: don't show A/V desync message in non-sense situations w32_common: add more rounded-down frame rates w32_common: use the current monitor's refresh rate dxva2: fix broken build with gcc 5.1 terminal: printf() is not signal-safe man: fix PDF build DOCS/mplayer-changes: Eleborate on joystick input osc: add nil check for element.eventresponder mp_image: remove some unused interlacing flags vf_vapoursynth: update _FieldBased semantics options: remove unneeded hack from command line parser manpage: document ff-index sub-property demux_mkv: limit timestamp fixing to 1ms max demux_mkv: attempt to fix rounded timestamps demux_mkv: move global options to the demuxer demux_mkv: better seeking after video end lua: add utils.format_json() function ...
Diffstat (limited to 'player/discnav.c')
-rw-r--r--player/discnav.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/player/discnav.c b/player/discnav.c
index d66b569d4b..719e88ac8f 100644
--- a/player/discnav.c
+++ b/player/discnav.c
@@ -42,6 +42,7 @@ struct mp_nav_state {
bool nav_eof;
bool nav_menu;
bool nav_draining;
+ bool nav_mouse_on_button;
// Accessed by OSD (possibly separate thread)
// Protected by the given lock
@@ -91,6 +92,25 @@ int mp_nav_in_menu(struct MPContext *mpctx)
return mpctx->nav_state ? mpctx->nav_state->nav_menu : -1;
}
+static void update_mouse_on_button(struct MPContext *mpctx)
+{
+ mp_notify_property(mpctx, "disc-mouse-on-button");
+}
+
+static void set_mouse_on_button(struct MPContext *mpctx, bool in)
+{
+ struct mp_nav_state *nav = mpctx->nav_state;
+ if (nav->nav_mouse_on_button != in) {
+ nav->nav_mouse_on_button = in;
+ update_mouse_on_button(mpctx);
+ }
+}
+
+bool mp_nav_mouse_on_button(struct MPContext *mpctx)
+{
+ return mpctx->nav_state ? mpctx->nav_state->nav_mouse_on_button : false;
+}
+
// If a demuxer is accessing the stream, we have to use demux_stream_control()
// to avoid synchronization issues; otherwise access it directly.
static int run_stream_control(struct MPContext *mpctx, int cmd, void *arg)
@@ -129,6 +149,7 @@ void mp_nav_init(struct MPContext *mpctx)
MP_INPUT_ALLOW_VO_DRAGGING | MP_INPUT_ALLOW_HIDE_CURSOR);
update_state(mpctx);
+ update_mouse_on_button(mpctx);
}
void mp_nav_reset(struct MPContext *mpctx)
@@ -159,6 +180,7 @@ void mp_nav_destroy(struct MPContext *mpctx)
talloc_free(mpctx->nav_state);
mpctx->nav_state = NULL;
update_state(mpctx);
+ update_mouse_on_button(mpctx);
}
void mp_nav_user_input(struct MPContext *mpctx, char *command)
@@ -182,6 +204,7 @@ void mp_nav_user_input(struct MPContext *mpctx, char *command)
inp.u.mouse_pos.x = x;
inp.u.mouse_pos.y = y;
run_stream_control(mpctx, STREAM_CTRL_NAV_CMD, &inp);
+ set_mouse_on_button(mpctx, inp.mouse_on_button);
} else {
struct mp_nav_cmd inp = {MP_NAV_CMD_MENU};
inp.u.menu.action = command;