diff options
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r-- | video/out/x11_common.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 5eb6031d66..9d2db30924 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -496,9 +496,6 @@ int vo_x11_init(struct vo *vo) fstype_dump(x11->fs_type); - if (opts->stop_screensaver) - saver_off(x11); - vo->event_fd = ConnectionNumber(x11->display); return 1; @@ -918,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); @@ -973,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) @@ -1025,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); @@ -1371,6 +1372,7 @@ static void vo_x11_border(struct vo *vo) int vo_x11_control(struct vo *vo, int *events, int request, void *arg) { + struct vo_x11_state *x11 = vo->x11; switch (request) { case VOCTRL_CHECK_EVENTS: *events |= vo_x11_check_events(vo); @@ -1392,6 +1394,15 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg) case VOCTRL_SET_CURSOR_VISIBILITY: vo_set_cursor_hidden(vo, !(*(bool *)arg)); return VO_TRUE; + case VOCTRL_KILL_SCREENSAVER: + saver_off(x11); + return VO_TRUE; + 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; } |