From 168a595bfeb97be89da314dcc652b7c4782e43e5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 15 Jun 2013 19:04:20 +0200 Subject: video/out: introduce VOCTRL_UPDATE_WINDOW_TITLE Instead of implicitly changing the window title on config(), do it as part of the new VOCTRL. At first I wanted to make all VOs use the VOCTRL argument directly, but on a second thought it appears vo_get_window_title() is much more useful for some (namely, if the window is created lazily on first config()). Not all VOs are changed. Wayland and OSX have to follow. --- video/out/x11_common.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'video/out/x11_common.c') diff --git a/video/out/x11_common.c b/video/out/x11_common.c index ecafc4a324..9d2db30924 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -915,6 +915,9 @@ static void vo_x11_update_window_title(struct vo *vo) { struct vo_x11_state *x11 = vo->x11; + if (!x11->window) + return; + const char *title = vo_get_window_title(vo); vo_x11_set_property_string(vo, XA_WM_NAME, title); vo_x11_set_property_string(vo, XA_WM_ICON_NAME, title); @@ -970,6 +973,8 @@ static void vo_x11_create_window(struct vo *vo, XVisualInfo *vis, int x, int y, XNClientWindow, x11->window, XNFocusWindow, x11->window, NULL); + + vo_x11_update_window_title(vo); } static void vo_x11_map_window(struct vo *vo, int x, int y, int w, int h) @@ -1022,7 +1027,6 @@ void vo_x11_config_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y, if (flags & VOFLAG_HIDDEN) return; - vo_x11_update_window_title(vo); if (opts->ontop) vo_x11_setlayer(vo, x11->window, opts->ontop); @@ -1396,6 +1400,9 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg) case VOCTRL_RESTORE_SCREENSAVER: saver_on(x11); return VO_TRUE; + case VOCTRL_UPDATE_WINDOW_TITLE: + vo_x11_update_window_title(vo); + return VO_TRUE; } return VO_NOTIMPL; } -- cgit v1.2.3