diff options
author | wm4 <wm4@nowhere> | 2013-06-15 19:04:20 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-06-15 19:07:21 +0200 |
commit | 168a595bfeb97be89da314dcc652b7c4782e43e5 (patch) | |
tree | c5e88c9eec004a8a5cd66a68ad4b1cdd1382b97a /video/out/x11_common.c | |
parent | 70f97efa720ee2366cb6c1eeefb211c11fd88a63 (diff) | |
download | mpv-168a595bfeb97be89da314dcc652b7c4782e43e5.tar.bz2 mpv-168a595bfeb97be89da314dcc652b7c4782e43e5.tar.xz |
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.
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r-- | video/out/x11_common.c | 9 |
1 files changed, 8 insertions, 1 deletions
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; } |