1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-11 08:37:59 +00:00

x11: add --x11-wid-title option

This deliberately wasn't being done when mpv was embedded
(fbccddb48b). There are some applications
that would benefit from mpv setting a title since they don't do so
themselves (such as tabbed), but at the same time some others would
probably rather not have this behavior (like smplayer). Add an option
that allows an embedded mpv to set the title if the user wishes.
Fixes #11528.
This commit is contained in:
Dudemanguy 2023-08-09 21:11:53 -05:00
parent e8a77e5279
commit 4a6abff812
5 changed files with 10 additions and 2 deletions

View File

@ -39,6 +39,7 @@ Interface changes
- The remaining time printed in the terminal is now adjusted for speed by default.
You can disable this with `--no-term-remaining-playtime`.
- add `playlist-path` and `playlist/N/playlist-path` properties
- add `--x11-wid-title` option
--- mpv 0.36.0 ---
- add `--target-contrast`
- Target luminance value is now also applied when ICC profile is used.

View File

@ -3437,6 +3437,10 @@ Window
mechanism in case there is good/bad behavior with whatever your combination
of hardware/drivers/etc. happens to be.
``--x11-wid-title`` ``--no-x11-wid-title``
Whether or not to set the window title when mpv is embedded on X11 (default:
``no``).
Disc Devices
------------

View File

@ -181,6 +181,7 @@ static const m_option_t mp_vo_opt_list[] = {
{"no", 0}, {"yes", 1}, {"fs-only", 2}, {"never", 3})},
{"x11-present", OPT_CHOICE(x11_present,
{"no", 0}, {"auto", 1}, {"yes", 2})},
{"x11-wid-title", OPT_BOOL(x11_wid_title)},
#endif
#if HAVE_WAYLAND
{"wayland-content-type", OPT_CHOICE(content_type, {"auto", -1}, {"none", 0},

View File

@ -32,6 +32,7 @@ typedef struct mp_vo_opts {
int x11_netwm;
int x11_bypass_compositor;
int x11_present;
bool x11_wid_title;
bool cursor_passthrough;
bool native_keyrepeat;

View File

@ -1575,10 +1575,11 @@ static void vo_x11_create_window(struct vo *vo, XVisualInfo *vis,
if (!x11->parent) {
vo_x11_update_composition_hint(vo);
vo_x11_set_wm_icon(x11);
vo_x11_update_window_title(vo);
vo_x11_dnd_init_window(vo);
vo_x11_set_property_utf8(vo, XA(x11, _GTK_THEME_VARIANT), "dark");
}
if (!x11->parent || x11->opts->x11_wid_title)
vo_x11_update_window_title(vo);
vo_x11_xembed_update(x11, 0);
}
@ -2126,7 +2127,7 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
case VOCTRL_UPDATE_WINDOW_TITLE:
talloc_free(x11->window_title);
x11->window_title = talloc_strdup(x11, (char *)arg);
if (!x11->parent)
if (!x11->parent || x11->opts->x11_wid_title)
vo_x11_update_window_title(vo);
return VO_TRUE;
case VOCTRL_GET_DISPLAY_FPS: {