mirror of
https://github.com/mpv-player/mpv
synced 2025-01-16 22:37:28 +01:00
options: move -name and -title to option struct
This commit is contained in:
parent
be95d4c131
commit
952f9b85a7
@ -159,8 +159,8 @@ const m_option_t mplayer_opts[]={
|
||||
OPT_FLAG_ON("force-window-position", force_window_position, 0),
|
||||
OPT_FLAG_OFF("noforce-window-position", force_window_position, 0),
|
||||
// vo name (X classname) and window title strings
|
||||
{"name", &vo_winname, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
{"title", &vo_wintitle, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
OPT_STRING("name", vo_winname, 0),
|
||||
OPT_STRING("title", vo_wintitle, 0),
|
||||
// set aspect ratio of monitor - useful for 16:9 TV-out
|
||||
OPT_FLOATRANGE("monitoraspect", force_monitor_aspect, 0, 0.0, 9.0),
|
||||
OPT_FLOATRANGE("monitorpixelaspect", monitor_pixel_aspect, 0, 0.2, 9.0),
|
||||
|
@ -70,10 +70,6 @@ int vo_directrendering=0;
|
||||
int vo_colorkey = 0x0000ff00; // default colorkey is green
|
||||
// (0xff000000 means that colorkey has been disabled)
|
||||
|
||||
// name to be used instead of the vo's default
|
||||
char *vo_winname;
|
||||
// title to be applied to movie window
|
||||
char *vo_wintitle;
|
||||
|
||||
//
|
||||
// Externally visible list of all vo drivers
|
||||
|
@ -322,9 +322,6 @@ extern char *vo_subdevice;
|
||||
|
||||
extern int vo_colorkey;
|
||||
|
||||
extern char *vo_winname;
|
||||
extern char *vo_wintitle;
|
||||
|
||||
extern int64_t WinID;
|
||||
|
||||
typedef struct {
|
||||
|
@ -706,11 +706,12 @@ void vo_x11_decoration(struct vo *vo, int d)
|
||||
|
||||
void vo_x11_classhint(struct vo *vo, Window window, const char *name)
|
||||
{
|
||||
struct MPOpts *opts = vo->opts;
|
||||
struct vo_x11_state *x11 = vo->x11;
|
||||
XClassHint wmClass;
|
||||
pid_t pid = getpid();
|
||||
|
||||
wmClass.res_name = vo_winname ? vo_winname : name;
|
||||
wmClass.res_name = opts->vo_winname ? opts->vo_winname : name;
|
||||
wmClass.res_class = "MPlayer";
|
||||
XSetClassHint(x11->display, window, &wmClass);
|
||||
XChangeProperty(x11->display, window, x11->XA_NET_WM_PID, XA_CARDINAL,
|
||||
@ -1308,6 +1309,7 @@ static int vo_x11_get_fs_type(int supported)
|
||||
*/
|
||||
int vo_x11_update_geometry(struct vo *vo)
|
||||
{
|
||||
struct MPOpts *opts = vo->opts;
|
||||
struct vo_x11_state *x11 = vo->x11;
|
||||
unsigned depth, w, h;
|
||||
int dummy_int;
|
||||
@ -1320,8 +1322,8 @@ int vo_x11_update_geometry(struct vo *vo)
|
||||
}
|
||||
XTranslateCoordinates(x11->display, x11->window, x11->rootwin, 0, 0,
|
||||
&vo->dx, &vo->dy, &dummy_win);
|
||||
if (vo_wintitle)
|
||||
XStoreName(x11->display, x11->window, vo_wintitle);
|
||||
if (opts->vo_wintitle)
|
||||
XStoreName(x11->display, x11->window, opts->vo_wintitle);
|
||||
|
||||
return depth <= INT_MAX ? depth : 0;
|
||||
}
|
||||
|
@ -3541,8 +3541,8 @@ while (player_idle_mode && !mpctx->filename) {
|
||||
if (mpctx->filename) {
|
||||
mp_tmsg(MSGT_CPLAYER,MSGL_INFO,"\nPlaying %s.\n",
|
||||
filename_recode(mpctx->filename));
|
||||
if(use_filename_title && vo_wintitle == NULL)
|
||||
vo_wintitle = strdup(mp_basename2(mpctx->filename));
|
||||
if(use_filename_title && opts->vo_wintitle == NULL)
|
||||
opts->vo_wintitle = strdup(mp_basename2(mpctx->filename));
|
||||
}
|
||||
|
||||
if (edl_filename) {
|
||||
|
Loading…
Reference in New Issue
Block a user