client API: rename --input-x11-keyboard to --input-vo-keyboard

Apparently we need this for Cocoa too. (The option was X11 specific in
the hope that only X11 would need this hack.)
This commit is contained in:
wm4
2014-10-09 18:28:37 +02:00
parent fef9ea5f62
commit e294656cb1
7 changed files with 18 additions and 12 deletions

View File

@@ -33,6 +33,8 @@ API changes
work as expected, and now the behavior can be explicitly controlled work as expected, and now the behavior can be explicitly controlled
with the "input-x11-keyboard" option. This is only a temporary with the "input-x11-keyboard" option. This is only a temporary
measure until XEmbed is implemented and confirmed working. measure until XEmbed is implemented and confirmed working.
Note: in 1.6, "input-x11-keyboard" was renamed to "input-vo-keyboard",
although the old option name still works.
1.4 - subtle change in X11 and "--wid" behavior 1.4 - subtle change in X11 and "--wid" behavior
(this change was added to 0.5.2, and broke some things, see #1090) (this change was added to 0.5.2, and broke some things, see #1090)
--- mpv 0.5.0 is released --- --- mpv 0.5.0 is released ---

View File

@@ -67,8 +67,8 @@ MainWindow::MainWindow(QWidget *parent) :
mpv_set_option_string(mpv, "input-default-bindings", "yes"); mpv_set_option_string(mpv, "input-default-bindings", "yes");
// Enable keyboard input on the X11 window. For the messy details, see // Enable keyboard input on the X11 window. For the messy details, see
// --input-x11-keyboard on the manpage. // --input-vo-keyboard on the manpage.
mpv_set_option_string(mpv, "input-x11-keyboard", "yes"); mpv_set_option_string(mpv, "input-vo-keyboard", "yes");
// Let us receive property change events with MPV_EVENT_PROPERTY_CHANGE if // Let us receive property change events with MPV_EVENT_PROPERTY_CHANGE if
// this property changes. // this property changes.

View File

@@ -2176,8 +2176,9 @@ Input
Use the right Alt key as Alt Gr to produce special characters. If disabled, Use the right Alt key as Alt Gr to produce special characters. If disabled,
count the right Alt as an Alt modifier key. Enabled by default. count the right Alt as an Alt modifier key. Enabled by default.
``--input-x11-keyboard=<yes|no>`` ``--input-vo-keyboard=<yes|no>``
Disable all keyboard input on the X11 VO window. Generally useful for Disable all keyboard input on for VOs which can't participate in proper
keyboard input dispatching. This currently affects X11. Generally useful for
embedding only. embedding only.
On X11, a sub-window with input enabled grabs all keyboard input as long On X11, a sub-window with input enabled grabs all keyboard input as long
@@ -2195,6 +2196,8 @@ Input
As a workaround, this option is disabled by default in libmpv. (Note that As a workaround, this option is disabled by default in libmpv. (Note that
``input-default-bindings`` is disabled by default in libmpv as well.) ``input-default-bindings`` is disabled by default in libmpv as well.)
(This option was renamed from ``--input-x11-keyboard``.)
OSD OSD
--- ---

View File

@@ -175,7 +175,7 @@ struct input_opts {
int use_media_keys; int use_media_keys;
int default_bindings; int default_bindings;
int enable_mouse_movements; int enable_mouse_movements;
int x11_key_input; int vo_key_input;
int test; int test;
}; };
@@ -196,7 +196,8 @@ const struct m_sub_options input_config = {
OPT_FLAG("right-alt-gr", use_alt_gr, CONF_GLOBAL), OPT_FLAG("right-alt-gr", use_alt_gr, CONF_GLOBAL),
OPT_INTRANGE("key-fifo-size", key_fifo_size, CONF_GLOBAL, 2, 65000), OPT_INTRANGE("key-fifo-size", key_fifo_size, CONF_GLOBAL, 2, 65000),
OPT_FLAG("cursor", enable_mouse_movements, CONF_GLOBAL), OPT_FLAG("cursor", enable_mouse_movements, CONF_GLOBAL),
OPT_FLAG("x11-keyboard", x11_key_input, CONF_GLOBAL), OPT_FLAG("vo-keyboard", vo_key_input, CONF_GLOBAL),
OPT_FLAG("x11-keyboard", vo_key_input, CONF_GLOBAL), // old alias
#if HAVE_LIRC #if HAVE_LIRC
OPT_STRING("lirc-conf", lirc_configfile, CONF_GLOBAL), OPT_STRING("lirc-conf", lirc_configfile, CONF_GLOBAL),
#endif #endif
@@ -220,7 +221,7 @@ const struct m_sub_options input_config = {
.use_media_keys = 1, .use_media_keys = 1,
#endif #endif
.default_bindings = 1, .default_bindings = 1,
.x11_key_input = 1, .vo_key_input = 1,
}, },
}; };
@@ -709,10 +710,10 @@ bool mp_input_mouse_enabled(struct input_ctx *ictx)
return r; return r;
} }
bool mp_input_x11_keyboard_enabled(struct input_ctx *ictx) bool mp_input_vo_keyboard_enabled(struct input_ctx *ictx)
{ {
input_lock(ictx); input_lock(ictx);
bool r = ictx->opts->x11_key_input; bool r = ictx->opts->vo_key_input;
input_unlock(ictx); input_unlock(ictx);
return r; return r;
} }

View File

@@ -156,7 +156,7 @@ void mp_input_get_mouse_pos(struct input_ctx *ictx, int *x, int *y);
// Return whether we want/accept mouse input. // Return whether we want/accept mouse input.
bool mp_input_mouse_enabled(struct input_ctx *ictx); bool mp_input_mouse_enabled(struct input_ctx *ictx);
bool mp_input_x11_keyboard_enabled(struct input_ctx *ictx); bool mp_input_vo_keyboard_enabled(struct input_ctx *ictx);
/* Make mp_input_set_mouse_pos() mangle the mouse coordinates. Hack for certain /* Make mp_input_set_mouse_pos() mangle the mouse coordinates. Hack for certain
* VOs. dst=NULL, src=NULL reset it. src can be NULL. * VOs. dst=NULL, src=NULL reset it. src can be NULL.

View File

@@ -403,7 +403,7 @@ mpv_handle *mpv_create(void)
mpv_set_option_string(ctx, "terminal", "no"); mpv_set_option_string(ctx, "terminal", "no");
mpv_set_option_string(ctx, "osc", "no"); mpv_set_option_string(ctx, "osc", "no");
mpv_set_option_string(ctx, "input-default-bindings", "no"); mpv_set_option_string(ctx, "input-default-bindings", "no");
mpv_set_option_string(ctx, "input-x11-keyboard", "no"); mpv_set_option_string(ctx, "input-vo-keyboard", "no");
mpv_set_option_string(ctx, "input-lirc", "no"); mpv_set_option_string(ctx, "input-lirc", "no");
} else { } else {
mp_destroy(mpctx); mp_destroy(mpctx);

View File

@@ -1265,7 +1265,7 @@ static void vo_x11_map_window(struct vo *vo, struct mp_rect rc)
LeaveWindowMask; LeaveWindowMask;
if (mp_input_mouse_enabled(vo->input_ctx)) if (mp_input_mouse_enabled(vo->input_ctx))
events |= PointerMotionMask | ButtonPressMask | ButtonReleaseMask; events |= PointerMotionMask | ButtonPressMask | ButtonReleaseMask;
if (mp_input_x11_keyboard_enabled(vo->input_ctx)) if (mp_input_vo_keyboard_enabled(vo->input_ctx))
events |= KeyPressMask | KeyReleaseMask; events |= KeyPressMask | KeyReleaseMask;
vo_x11_selectinput_witherr(vo, x11->display, x11->window, events); vo_x11_selectinput_witherr(vo, x11->display, x11->window, events);
XMapWindow(x11->display, x11->window); XMapWindow(x11->display, x11->window);