From d4de92e80897abb64dc8ccecb7823cbe291bb52d Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 6 Dec 2011 20:23:54 +0100 Subject: libvo: remove title argument from struct vo_driver.config This affects only the "new" VO API. The config() title argument was barely used, and it's hardcoded to "MPlayer" in vf_vo.c. The X11 and the Cocoa GUI backends, which are the only ones properly supporting window titles, ignored this argument. Remove the title argument. Add the vo_get_window_title function. All GUI VOs are supposed to use it for the window title. --- libvo/video_out.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'libvo/video_out.c') diff --git a/libvo/video_out.c b/libvo/video_out.c index e796784b1e..8c2f551e4c 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -437,7 +437,7 @@ static int event_fd_callback(void *ctx, int fd) int vo_config(struct vo *vo, uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, - char *title, uint32_t format) + uint32_t format) { struct MPOpts *opts = vo->opts; panscan_init(vo); @@ -458,7 +458,7 @@ int vo_config(struct vo *vo, uint32_t width, uint32_t height, } int ret = vo->driver->config(vo, width, height, d_width, d_height, flags, - title, format); + format); vo->config_ok = (ret == 0); vo->config_count += vo->config_ok; if (vo->registered_fd == -1 && vo->event_fd != -1 && vo->config_ok) { @@ -552,6 +552,18 @@ void calc_src_dst_rects(struct vo *vo, int src_width, int src_height, dst->height = dst->bottom - dst->top; } +// Return the window title the VO should set. Always returns a null terminated +// string. The string is valid until frontend code is invoked again. Copy it if +// you need to keep the string for an extended period of time. +const char *vo_get_window_title(struct vo *vo) +{ + if (vo->opts->vo_wintitle) { + return vo->opts->vo_wintitle; + } else { + return "MPlayer"; + } +} + /** * Generates a mouse movement message if those are enable and sends it * to the "main" MPlayer. -- cgit v1.2.3 From 82118dc35edfbf9b6714e1e4e6b1823fc3205ff7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 5 Dec 2011 23:17:34 +0100 Subject: libvo: change default window title to "mplayer2" Also change the WM_CLASS "application class" string from "MPlayer" to "mplayer2". This string is visible as application name in Gnome 3. --- libvo/video_out.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libvo/video_out.c') diff --git a/libvo/video_out.c b/libvo/video_out.c index 8c2f551e4c..2333afcb80 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -560,7 +560,7 @@ const char *vo_get_window_title(struct vo *vo) if (vo->opts->vo_wintitle) { return vo->opts->vo_wintitle; } else { - return "MPlayer"; + return "mplayer2"; } } -- cgit v1.2.3