diff options
author | wm4 <wm4@nowhere> | 2015-12-06 18:39:09 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-12-06 18:41:31 +0100 |
commit | 9db50c6760758089a013983f0fbf93ebde53dbc7 (patch) | |
tree | b37322cdb821fdfea5e3efe190fd25b593cfdbd1 /video/out/x11_common.c | |
parent | 970606e49198594c243edf4a85c426693676f6a3 (diff) | |
download | mpv-9db50c6760758089a013983f0fbf93ebde53dbc7.tar.bz2 mpv-9db50c6760758089a013983f0fbf93ebde53dbc7.tar.xz |
vo: get rid of vo_get_window_title()
It always was a weird artifact - VOCTRLs are meant _not_ to require
special handling in the code that passes them through (like in vo.c).
Removing it is also interesting to further reduce the dependency of
backends on struct vo. Just get rid of it.
Removing it is somewhat inconvenient, because in many situations the UI
window is created after the first VOCTRL_UPDATE_WINDOW_TITLE. This means
these backends have to store it in a new field in their own context.
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r-- | video/out/x11_common.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 95308b9559..dd7565512e 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -1194,14 +1194,13 @@ static void vo_x11_update_window_title(struct vo *vo) { struct vo_x11_state *x11 = vo->x11; - if (!x11->window) + if (!x11->window || !x11->window_title) 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); - vo_x11_set_property_utf8(vo, XA(x11, _NET_WM_NAME), title); - vo_x11_set_property_utf8(vo, XA(x11, _NET_WM_ICON_NAME), title); + vo_x11_set_property_string(vo, XA_WM_NAME, x11->window_title); + vo_x11_set_property_string(vo, XA_WM_ICON_NAME, x11->window_title); + vo_x11_set_property_utf8(vo, XA(x11, _NET_WM_NAME), x11->window_title); + vo_x11_set_property_utf8(vo, XA(x11, _NET_WM_ICON_NAME), x11->window_title); } static void vo_x11_xembed_update(struct vo_x11_state *x11, int flags) @@ -1804,6 +1803,8 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg) set_screensaver(x11, true); return VO_TRUE; case VOCTRL_UPDATE_WINDOW_TITLE: + talloc_free(x11->window_title); + x11->window_title = talloc_strdup(x11, (char *)arg); if (!x11->parent) vo_x11_update_window_title(vo); return VO_TRUE; |